Module prelude

Module prelude 

Source
Expand description

Provides a prelude for easy importing of commonly used items.

§Examples

use tf2_enum::prelude::*;

let quality = Quality::Strange;
println!("Item quality: {:?}", quality);
 
let spell = FootprintsSpell::HeadlessHorseshoes;
println!("{}: {}", FootprintsSpell::DEFINDEX, spell as u32);

Re-exports§

pub use crate::Attribute;
pub use crate::Attributes;
pub use crate::AttributeSet;
pub use crate::TryFromIntAttributeValue;
pub use crate::Colored;
pub use crate::HasItemDefindex;
pub use crate::Class;
pub use crate::FootprintsSpell;
pub use crate::Grade;
pub use crate::ItemLevel;
pub use crate::ItemSlot;
pub use crate::KillEaterScoreType;
pub use crate::KillstreakTier;
pub use crate::Killstreaker;
pub use crate::Origin;
pub use crate::Paint;
pub use crate::PaintSpell;
pub use crate::Quality;
pub use crate::Sheen;
pub use crate::Spell;
pub use crate::StrangePart;
pub use crate::Wear;
pub use crate::SpellSet;
pub use crate::StrangePartSet;

Traits§

EnumCount
A trait for capturing the number of variants in Enum. This trait can be autoderived by strum_macros.
IntoEnumIterator
This trait designates that an Enum can be iterated over. It can be auto generated using the EnumIter derive macro.
TryFromPrimitive

Derive Macros§

EnumCount
Add a constant usize equal to the number of variants.
IntoPrimitive
Implements Into<Primitive> for a #[repr(Primitive)] enum.
TryFromPrimitive
Implements TryFrom<Primitive> for a #[repr(Primitive)] enum.