rick-and-morty

Crates.iorick-and-morty
lib.rsrick-and-morty
version0.1.0
sourcesrc
created_at2020-12-16 07:36:05.187302
updated_at2020-12-16 07:36:05.187302
descriptionA rust wrapper for rickandmortyapi.com
homepagehttps://github.com/dshomoye/rick-and-morty
repositoryhttps://github.com/dshomoye/rick-and-morty
max_upload_size
id323507
size69,128
Damola Shomoye (dshomoye)

documentation

README

Rick And Morty Rust Helper

This is a rust crate for working with the rick and morty api here. Primarily a learning (rust) experience for me. Contributions welcome!


Usage

  • Get a single character by id:
 extern crate rick_and_morty as rm;

 async fn get_character() -> () {
   let c = rm::character::get(1).await;
   match c {
       Ok(res) => println!("{:?}", res),
       Err(e) => println!("{:?}", e),
    }
}
  • Get all characters
 extern crate rick_and_morty as rm;

 async fn get_characters() -> () {
   let c = rm::character::get_all().await;
   match c {
       Ok(res) => println!("{:?}", res),
       Err(e) => println!("{:?}", e),
    }
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 33

cargo fmt