#fortress

tf2-enum

Provides enumerated types for models related to the Team Fortress 2 item schema

18 releases

0.9.3 May 19, 2024
0.9.1 Oct 8, 2023
0.8.1 Feb 27, 2023
0.6.0 Oct 14, 2022
0.3.1 Mar 17, 2022

#2 in #fortress


Used in tf2-sku

MIT license

51KB
1K SLoC

tf2-enum

Provides enumerated types for models related to the Team Fortress 2 item schema.

Usage

use tf2_enum::{Quality, KillstreakTier};
use std::str::FromStr;

assert_eq!(
    "Unusual".parse::<Quality>().unwrap(),
    Quality::Unusual,
);
assert_eq!(
    Quality::Unusual as u32,
    5,
);
assert_eq!(
    KillstreakTier::Professional.to_string(),
    "Professional Killstreak",
);

License

MIT


lib.rs:

tf2-enum

Provides enumerated types for models related to the Team Fortress 2 item schema.

Usage

use tf2_enum::{Quality, KillstreakTier};
use std::str::FromStr;

assert_eq!(
    "Unusual".parse::<Quality>().unwrap(),
    Quality::Unusual,
);
assert_eq!(
    Quality::Unusual as u32,
    5,
);
assert_eq!(
    KillstreakTier::Professional.to_string(),
    "Professional Killstreak",
);

Dependencies

~0.4–1MB
~23K SLoC