2018-05-04 00:39:40 -05:00
|
|
|
# I Can Has Cat
|
|
|
|
[The Cat API](http://thecatapi.com/) client in Rust.
|
2018-05-03 22:54:56 -05:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
### Command Line
|
2018-05-04 00:39:40 -05:00
|
|
|
* `cargo run`: output list of categories
|
|
|
|
* `cargo run random`: output random cat
|
|
|
|
* `cargo run random <category>` output random cat of category
|
2018-05-03 22:54:56 -05:00
|
|
|
|
|
|
|
### Library
|
|
|
|
|
2018-05-04 00:39:40 -05:00
|
|
|
use i_can_has_cat::Cats;
|
|
|
|
let cats = Cats::new();
|
|
|
|
let categories = cats.categories();
|
|
|
|
let random_cat = cats.random_image();
|
|
|
|
let random_cat_of_breed = cats.random_image_of_category("<category>");
|