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§
pub use num_enum;
pub use strum;
pub use strum_macros;
Modules§
Enums§
- Class
- Class.
- Craft
Class - Craft class.
- Craft
Material Type - Craft material type.
- Footprints
Spell - Footprints spell.
- Grade
- Grade.
- Item
Slot - Item slot.
- Killstreak
Tier - Killstreak tier.
- Killstreaker
- Killstreaker.
- Origin
- Origin.
- Paint
- Paint.
repr
values are mapped to the corresponding color. For team paints this is the color for RED team. - Paint
Spell - Paint spell.
- Quality
- Quality.
- Sheen
- Sheen.
- Spell
- Spell.
- Strange
Part - Strange part.
repr
values are mapped to theirkill_eater_score_type
attribute value. - Wear
- Wear.
Traits§
- Attribute
- The
defindex
value for an item attribute. - Attributes
- The
defindex
values for a set of item attributes. - Enum
Count - A trait for capturing the number of variants in Enum. This trait can be autoderived by
strum_macros
. - Into
Enum Iterator - This trait designates that an
Enum
can be iterated over. It can be auto generated using theEnumIter
derive macro.