pub struct Weapon {
pub name: String,
pub sticker_amount: u32,
pub weapon_type: String,
pub faction: Option<String>,
pub paints: HashMap<String, Paint>,
}Expand description
Weapon information with paints and pricing
Fields§
§name: String§sticker_amount: u32§weapon_type: String§faction: Option<String>§paints: HashMap<String, Paint>Implementations§
Source§impl Weapon
impl Weapon
Sourcepub fn get_paint_by_index(&self, index: u32) -> Option<&Paint>
pub fn get_paint_by_index(&self, index: u32) -> Option<&Paint>
Get a paint by its index
Sourcepub fn get_paint_by_name(&self, name: &str) -> Option<&Paint>
pub fn get_paint_by_name(&self, name: &str) -> Option<&Paint>
Get a paint by its name
Sourcepub fn paints_by_rarity(&self) -> Vec<&Paint>
pub fn paints_by_rarity(&self) -> Vec<&Paint>
Get all paints for this weapon sorted by rarity (highest first)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Weapon
impl<'de> Deserialize<'de> for Weapon
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Weapon
impl RefUnwindSafe for Weapon
impl Send for Weapon
impl Sync for Weapon
impl Unpin for Weapon
impl UnwindSafe for Weapon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more