igdb_api_rust/lib.rs
1//!# IGDB API Rust
2//!
3//! This is a wrapper for the IGDB REST API. It contains all the protocol buffers compiled using PROST which makes it typesafe.
4//!
5//!
6//! ## Usage
7//! ```rust
8//! use igdb_api_rust::*;
9//! use igdb_api_rust::client::Client;
10//! use igdb_api_rust::apicalypse_builder::ApicalypseBuilder;
11//! use igdb_api_rust::igdb::GameResult;
12//!
13//! #[tokio::main]
14//! async fn main() {
15//! // Default trait will get the credentials from the env vars: IGDB_API_ID and IGDB_API_SECRET
16//! // Otherwise you can use the "new" method to supply them in your own way.
17//! let mut client = Client::new("test","test");
18//!
19//! let query = ApicalypseBuilder::default().filter("id > 1337")
20//! .limit(55)
21//! .offset(66)
22//! .fields("*")
23//! .exclude("id,name")
24//! .sort("id desc");
25//!
26//! // IF you prefer you can use the request_raw method.
27//! if let Ok(game_result) = client.request::<GameResult>(&query).await {
28//! // Do something with the game results.
29//! }
30//!
31//! // The generic "GameResult" is required for knowing what endpoint it uses.
32//! if let Ok(game_result_count) = client.request_count::<GameResult>(&query).await {
33//! // Do something with the game count.
34//! }
35//! }
36//! ```
37
38
39
40pub mod apicalypse_builder;
41pub mod client;
42pub mod igdb;