quake_clientinfo

Crates.ioquake_clientinfo
lib.rsquake_clientinfo
version0.3.0
sourcesrc
created_at2024-05-02 12:27:24.677731
updated_at2024-06-04 13:55:22.126725
descriptionParse QuakeWorld clientinfo strings.
homepage
repositoryhttps://github.com/vikpe/quake_clientinfo
max_upload_size
id1227708
size5,895
Viktor Persson (vikpe)

documentation

README

quake_clientinfo Test crates docs.rs

Parse QuakeWorld clientinfo strings

Usage

use quake_clientinfo::Clientinfo;

let info = Clientinfo::from(r#"\team\red\name\Alpha\*spectator\1"#);
assert_eq!(info.name, Some("Alpha".to_string()));
assert_eq!(info.team, Some("red".to_string()));
assert_eq!(info.spectator, Some(1));
assert_eq!(info.topcolor, None);

Fields

pub struct Clientinfo {
    pub name: Option<String>,
    pub team: Option<String>,
    pub topcolor: Option<i32>,
    pub bottomcolor: Option<i32>,
    pub spectator: Option<i32>,
    pub client: Option<String>,
    pub bot: Option<i32>,
    pub chat: Option<i32>,
}

See also

Commit count: 9

cargo fmt