[−][src]Crate rick_and_morty
rick_and_morty
The rick_and_morty
crate provides a wrapper around rickandmortyapi.com
It exports all the basic entities available from the api:
Each module provides: get
, get_all
, get_multiple
for equvailent REST endpoints and matching structs.
The structs also have helper methods for getting related entities.
For example Character.origin()
method returns a Location
object.
All provided functions/methods are asynchronous:
Examples:
- Getting all characters:
use 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), } }
- Getting a single location:
use rick_and_morty as rm; async fn get_location() -> () { let c = rm::location::get(1).await; match c { Ok(res) => println!("{:?}", res), Err(e) => println!("{:?}", e), } }
Modules
character |
|
episode |
|
location |
|
Structs
Error | The Errors that may occur when processing a |
Info | data about the page |
Object |
|
PageResponse |
|