[Crate] Add better documentation for generic game implementation (#49)

This commit is contained in:
Tom 2023-06-14 20:25:26 +00:00 committed by GitHub
parent 08e00c64e4
commit 4b081371f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 28 additions and 2 deletions

View file

@ -2,6 +2,7 @@
//!
//! # Usage example:
//!
//! ## For a specific game
//! ```
//! use gamedig::games::tf2;
//!
@ -12,12 +13,26 @@
//! }
//! ```
//!
//! ## Using a game definition
//! ```
//! use gamedig::games::{GAMES, query};
//!
//! let game = GAMES.get("tf2").unwrap(); // Get a game definition, the full list can be found in src/games/mod.rs
//! let response = query(game, &"127.0.0.1".parse().unwrap(), None); // None will use the default port
//! match response {
//! Err(error) => println!("Couldn't query, error: {}", error),
//! Ok(r) => println!("{:#?}", r),
//! }
//! ```
//!
//! # Crate features:
//! Enabled by default: None
//! Enabled by default: `game_defs`
//!
//! `serde` - enables json serialization/deserialization for all response types.
//! <br> `no_games` - disables the included games support. <br>
//! `no_services` - disables the included services support.
//! `no_services` - disables the included services support. <br>
//! `game_defs` - Include game definitions for programmatic access (enabled by
//! default).
pub mod errors;
#[cfg(not(feature = "no_games"))]