mirror of
https://github.com/tribufu/rust-gamedig
synced 2026-06-01 09:42:41 +00:00
[Crate] Add better documentation for generic game implementation (#49)
This commit is contained in:
parent
08e00c64e4
commit
4b081371f4
6 changed files with 28 additions and 2 deletions
19
src/lib.rs
19
src/lib.rs
|
|
@ -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"))]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue