Crates.io | rustemon |
lib.rs | rustemon |
version | |
source | src |
created_at | 2021-11-04 11:48:58.973078 |
updated_at | 2024-12-11 15:48:25.075479 |
description | Library wrapping the awesome PokeAPI |
homepage | https://github.com/mlemesle/rustemon |
repository | https://github.com/mlemesle/rustemon |
max_upload_size | |
id | 476607 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This library is a wrapper for the awesome PokeApi, which provides all the informations you need about Pokémons !
Fully written in Rust, this library covers the whole PokeApi REST api v2.
Adds the following in the dependencies of your Cargo.toml :
rustemon = "4.0.0"
As you noticed in the documentation of PokeApi, every endpoints and models are declared in groups.
The library kept this group oriented architecture !
To support easier export to other tooling and libraries, the serialize
feature enables PokeApi structs to be compiled with serde::Serialize
.
This feature is disabled by default.
[dependencies]
rustemon = { version = "*", features = ["serialize"] }
All the models are located into the following module :
rustemon::model
For example, if you want the type Pokemon
located in the group pokemon
, it is located here :
rustemon::model::pokemon::Pokemon
The endpoints follow the same naming rule, for example, if you want to call the evolution chain endpoint from the evolution group :
rustemon::evolution::evolution_chain
For each endpoints, 4 functions are defined :
The endpoints are all async ! Which means you NEED to add a async runtime (such as tokio for example), in order for the library to work.
All calls to the API are cached by a middleware attached to the RustemonClient you need to instanciate in order to make calls to the PokeAPI.
Examples and use cases are available in the examples
folder. For instance, you can run the async_follow
example using
cargo run --example async_follow
The license of the library can be found here.
If you find any bug or improvement that you find valuable, please fill an issue right there -> project issues