csgo_gsi/lib.rs
1//! Helper library for the [CS:GO Game State Integration (GSI) API][gsi].
2//!
3//! Best used with the [tokio](https://tokio.rs/) async ecosystem.
4//!
5//! [gsi]: https://developer.valvesoftware.com/wiki/Counter-Strike:_Global_Offensive_Game_State_Integration
6//!
7//! # Simple Example
8//!
9//! ```no_run
10//! use csgo_gsi::{GSIConfigBuilder, GSIServer, Subscription};
11//!
12//! #[tokio::main]
13//! async fn main() {
14//! let config = GSIConfigBuilder::new("csgo-gsi Example")
15//! .subscribe_multiple(Subscription::UNRESTRICTED)
16//! .build();
17//!
18//! let mut server = GSIServer::new(config, 31337);
19//! server.add_listener(|update| println!("Got an update {:#?}", update));
20//!
21//! server
22//! .run()
23//! .await
24//! .expect("server didn't start");
25//! }
26//! ```
27#![deny(missing_docs)]
28#![doc(html_root_url = "https://docs.rs/csgo-gsi/0.3.0")]
29
30#[macro_use]
31extern crate gotham_derive;
32
33mod config;
34mod error;
35mod install_dir;
36mod server;
37pub mod update;
38
39pub use config::{Subscription, GSIConfigBuilder, GSIConfig};
40pub use error::Error;
41pub use server::GSIServer;
42pub use update::Update;