rustemon 4.5.0

Library wrapping the awesome PokeAPI
Documentation
use std::time::Duration;

use rustemon::client::{CacheMode, CacheOptions, Environment, MokaManager, RustemonClientBuilder};

#[tokio::main]
async fn main() {
    let rustemon_client = RustemonClientBuilder::default()
        .with_mode(CacheMode::NoStore)
        .with_manager(MokaManager::default())
        .with_options(CacheOptions {
            shared: true,
            cache_heuristic: 0.2,
            immutable_min_time_to_live: Duration::from_secs(3600),
            ignore_cargo_cult: true,
        })
        .with_environment(Environment::Custom(
            "https://pokeapi.co/api/v2/".parse().unwrap(),
        ))
        .try_build()
        .unwrap();

    let location_area = rustemon::locations::location_area::get_by_id(296, &rustemon_client)
        .await
        .unwrap();

    println!("{location_area:#?}");
}