ddragon
Rust library for accessing the latest LoL patch's ddragon data.
- Full JSON deserialization via
serde_json - Provides a synchronous API by default
- Local caching via
cacache-sync - Accepts custom
ureqagents (which can use the exposed cache middleware)
- Local caching via
- Optionally, an asynchronous API can be used that maintains the same featureset
- Local caching is handled by
http-cache-reqwestrather than a custom middleware - Also accepts custom
reqwestorreqwest-middlewareclients
- Local caching is handled by
Usage
use ;
Features
The following crate features are available:
sync(on by default) enables the synchronous client.- Provides the
ddragon::clientandddragon::cache_middlewaremodule. - Provides the re-exported
ddragon::DDragonClientclient. - Adds
cacache-sync,url,thiserror, andureqwith thejsonfeature enabled as dependencies.
- Provides the
asyncenables the asynchronous client.- Provides the
ddragon::async_clientmodule. - Provides the re-exported
ddragon::AsyncDDragonClientclient. - Adds
reqwestwith thejsonfeature,reqwest-middlewareandhttp-cache-reqwestas dependencies.
- Provides the
To use the library with just the synchronous version, it should be as simple as adding any other dependency:
[]
= "<version>"
If you want the asynchronous client only, you probably don't want to pull in the dependencies related to the synchronous code, so you can do this:
[]
= { = "<version>", = false, = ["async"] }
If you only want the DDragon models (none of the client code), you can use
[]
= { = "<version>", = false }
Roadmap
- Support all
.jsonendpoints related to League of Legends - Support endpoints related to Teamfight Tactics
- Add additional helpers for obtaining image assets
- Add an async API using
reqwestas the backend - Improve docs