diff --git a/riven/src/consts/mod.rs b/riven/src/consts/mod.rs index c53cc1e..613d664 100644 --- a/riven/src/consts/mod.rs +++ b/riven/src/consts/mod.rs @@ -8,35 +8,43 @@ mod macros; +#[rustfmt::skip] mod champion; pub use champion::*; mod division; pub use division::*; +#[rustfmt::skip] mod game_mode; pub use game_mode::*; +#[rustfmt::skip] mod game_type; pub use game_type::*; +#[rustfmt::skip] mod map; pub use map::*; +#[rustfmt::skip] mod queue_type; pub use queue_type::*; +#[rustfmt::skip] mod queue; pub use queue::*; pub mod ranks; +#[rustfmt::skip] mod route; pub use route::*; mod route_ext; pub use route_ext::*; +#[rustfmt::skip] mod season; pub use season::*; diff --git a/riven/src/lib.rs b/riven/src/lib.rs index 3297b5c..89f78ca 100644 --- a/riven/src/lib.rs +++ b/riven/src/lib.rs @@ -19,46 +19,46 @@ //! //! //!
-//! +//! //! Rust Library for the [Riot Games API](https://developer.riotgames.com/). -//! +//! //! Riven's goals are _speed_, _reliability_, and _maintainability_. Riven handles rate limits and large requests with ease. //! Data structs and endpoints are automatically generated from the //! [Riot API Reference](https://developer.riotgames.com/api-methods/) ([Swagger](http://www.mingweisamuel.com/riotapi-schema/tool/)). -//! +//! //! # Design -//! +//! //! * Fast, asynchronous, thread-safe. //! * Automatically retries failed requests. //! * Supports all endpoints, kept up-to-date using [riotapi-schema](https://github.com/MingweiSamuel/riotapi-schema). -//! +//! //! # Usage -//! +//! //! ```rust //! use riven::RiotApi; //! use riven::consts::PlatformRoute; -//! +//! //! // Enter tokio async runtime. //! let rt = tokio::runtime::Runtime::new().unwrap(); //! rt.block_on(async { //! // Create RiotApi instance from key string. //! let api_key = std::env!("RGAPI_KEY"); // "RGAPI-01234567-89ab-cdef-0123-456789abcdef"; //! let riot_api = RiotApi::new(api_key); -//! +//! //! // Get summoner data. //! let summoner = riot_api.summoner_v4() //! .get_by_summoner_name(PlatformRoute::NA1, "잘 못").await //! .expect("Get summoner failed.") //! .expect("There is no summoner with that name."); -//! +//! //! // Print summoner name. //! println!("{} Champion Masteries:", summoner.name); -//! +//! //! // Get champion mastery data. //! let masteries = riot_api.champion_mastery_v4() //! .get_all_champion_masteries(PlatformRoute::NA1, &summoner.id).await //! .expect("Get champion masteries failed."); -//! +//! //! // Print champion masteries. //! for (i, mastery) in masteries.iter().take(10).enumerate() { //! println!("{: >2}) {: <9} {: >7} ({})", i + 1, @@ -85,104 +85,104 @@ //! contains additional usage information. The [tests](https://github.com/MingweiSamuel/Riven/tree/v/2.x.x/riven/tests) //! and [example proxy](https://github.com/MingweiSamuel/Riven/tree/v/2.x.x/example/proxy) //! provide more example usage. -//! +//! //! ## Feature Flags -//! +//! //! ### Nightly vs Stable -//! +//! //! Enable the `nightly` feature to use nightly-only functionality. This enables //! [nightly optimizations in the `parking_lot` crate](https://github.com/Amanieu/parking_lot#nightly-vs-stable). -//! +//! //! ```toml //! riven = { version = "...", features = [ "nightly" ] } //! ``` -//! +//! //! ### rustls -//! +//! //! Riven uses [reqwest](https://github.com/seanmonstar/reqwest) for making requests. By default, reqwest uses the native TLS library. //! If you prefer using [rustls](https://github.com/ctz/rustls) you can do so by turning off the Riven default features //! and specifying the `rustls-tls` feature: -//! +//! //! ```toml //! riven = { version = "...", default-features = false, features = [ "rustls-tls" ] } //! ``` -//! +//! //! Riven is additionally able to produce [tracing](https://docs.rs/tracing) spans for requests if the `tracing` feature is enabled. This feature is disabled by default. -//! +//! //! ## Docs -//! +//! //! [On docs.rs](https://docs.rs/riven/). -//! +//! //! ## Error Handling -//! +//! //! Riven returns either `Result