ddragon 0.3.1

Library for pulling data from ddragon, with caching support.
Documentation

ddragon

latest version health check status downloads of latest version latest docs

Rust library for accessing the latest LoL patch's ddragon data.

  • Full JSON deserialization via serde_json
  • Local caching via cacache-sync
  • Accepts custom ureq agents (which can use the exposed cache middleware)

Usage

use ddragon::{cache_middleware::CacheMiddleware, client::DDragonClientError, DDragonClient};

fn main() -> Result<(), DDragonClientError> {
    // Using caching, the preferred option.
    // If you do not want caching enabled, disable the "local-cache" feature.
    let client = DDragonClient::new("/path/to/your/cache/dir")?;

    // If you want to use an existing agent
    let my_agent = ureq::AgentBuilder::new()
        .middleware(CacheMiddleware::new("/path/to/your/cache/dir"))
        .build();
    let client = DDragonClient::with_agent(my_agent)?;

    // See available options on the client and in the models folder.
    let champions = client.champions()?;
    let runes = client.runes()?;

    Ok(())
}

Roadmap

  • Support all .json endpoints related to League of Legends
  • Support endpoints related to Teamfight Tactics
  • Add additional helpers for obtaining image assets
  • Add an async API using reqwest as the backend
  • Improve docs