Crate tf2_enum

source ·
Expand description

§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",
);

Re-exports§

Modules§

Enums§

Traits§

  • The defindex value for an item attribute.
  • The defindex values for a set of item attributes.
  • A trait for capturing the number of variants in Enum. This trait can be autoderived by strum_macros.
  • This trait designates that an Enum can be iterated over. It can be auto generated using strum_macros on your behalf.