Crates.io | tf2-enum |
lib.rs | tf2-enum |
version | 0.9.3 |
source | src |
created_at | 2022-02-12 15:28:32.971748 |
updated_at | 2024-05-19 03:47:06.469446 |
description | Provides enumerated types for models related to the Team Fortress 2 item schema. |
homepage | https://github.com/juliarose/tf2-enum |
repository | https://github.com/juliarose/tf2-enum |
max_upload_size | |
id | 531370 |
size | 55,651 |
Provides enumerated types for models related to the Team Fortress 2 item schema.
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",
);