pokerust
Wrapper library for https://pokeapi.co/ v2 with caching support.
Documentation
Documentation for the crate can be found on docs.rs (WIP). For documentation of the API, see https://pokeapi.co/docs/v2.html.
Basic Usage
Get an object from an API by id
use ;
or by name
use ;
API responses are automatically cached.
You can also fetch the resource lists:
use ;
To get resources pointed to by (Named)APIResource, use get():
let berry = from_name.unwrap;
let berry_item = berry.item.get.unwrap; // berry_item is an Item
This can be chained:
let marill = from_name.unwrap;
let sea_incense = marill.evolution_chain.get.unwrap.baby_trigger_item.unwrap.get.unwrap;
The location of the pokeapi used can be changed by setting the POKERUST_ENDPOINT environment variable. Defaults to the public instance at https://pokeapi.co/api/v2/. Please consult the pokeapi documentation and read the fair use policy before using the public API instance.
License
This software is licensed under the BSD 3-Clause "New" or "Revised" License.