rusty_hyrule_compendium/
lib.rs

1//! This crate is a Rust library for the [Hryule Compendium API](https://github.com/gadhagod/Hyrule-Compendium-API)
2//!
3//! The resources provided by the above API as of version two and this create exposes a client `CompendiumClient` that has convienent methods to fetch associated data:
4//!
5//! ```rust
6//! use rusty_hyrule_compendium::blocking::{CompendiumApiClient, CompendiumClient};
7//! use rusty_hyrule_compendium::domain::inputs::EntryIdentifier;
8//! use rusty_hyrule_compendium::Result;
9//!
10//! fn main() -> Result<()> {
11//!     // Preconfigured client using v2 of the API
12//!     let client = CompendiumClient::default();
13//!     // Requests can fail for a number of reasons, see the error module for available errors
14//!     let monster_entry = client.monster(EntryIdentifier::Id(123))?;
15//!     // "white-maned lynel"
16//!     let monster_name = monster_entry.name();
17//!     // "https://botw-compendium.herokuapp.com/api/v2/entry/white-maned_lynel/image"
18//!     let image = monster_entry.image();
19//!     Ok(())
20//! }
21//! ```
22//!
23#![deny(
24    missing_docs,
25    missing_debug_implementations,
26    trivial_casts,
27    trivial_numeric_casts,
28    unsafe_code,
29    unstable_features,
30    unused_import_braces,
31    unused_qualifications
32)]
33
34pub mod blocking;
35pub mod domain;
36mod error;
37mod result;
38
39pub use error::CompendiumError;
40pub use result::Result;