veloren_common::comp::inventory::item

Trait ItemDesc

Source
pub trait ItemDesc {
Show 15 methods // Required methods fn description(&self) -> &str; fn name(&self) -> Cow<'_, str>; fn kind(&self) -> Cow<'_, ItemKind>; fn amount(&self) -> NonZeroU32; fn quality(&self) -> Quality; fn num_slots(&self) -> u16; fn item_definition_id(&self) -> ItemDefinitionId<'_>; fn tags(&self) -> Vec<ItemTag>; fn is_modular(&self) -> bool; fn components(&self) -> &[Item]; fn has_durability(&self) -> bool; fn durability_lost(&self) -> Option<u32>; fn stats_durability_multiplier(&self) -> DurabilityMultiplier; // Provided methods fn tool_info(&self) -> Option<ToolKind> { ... } fn i18n(&self, i18n: &ItemI18n) -> (Content, Content) { ... }
}
Expand description

Provides common methods providing details about an item definition for either an Item containing the definition, or the actual ItemDef

Required Methods§

Source

fn description(&self) -> &str

👎Deprecated: since item i18n
Source

fn name(&self) -> Cow<'_, str>

👎Deprecated: since item i18n
Source

fn kind(&self) -> Cow<'_, ItemKind>

Source

fn amount(&self) -> NonZeroU32

Source

fn quality(&self) -> Quality

Source

fn num_slots(&self) -> u16

Source

fn item_definition_id(&self) -> ItemDefinitionId<'_>

Source

fn tags(&self) -> Vec<ItemTag>

Source

fn is_modular(&self) -> bool

Source

fn components(&self) -> &[Item]

Source

fn has_durability(&self) -> bool

Source

fn durability_lost(&self) -> Option<u32>

Source

fn stats_durability_multiplier(&self) -> DurabilityMultiplier

Provided Methods§

Source

fn tool_info(&self) -> Option<ToolKind>

Source

fn i18n(&self, i18n: &ItemI18n) -> (Content, Content)

Return name’s and description’s localization descriptors

Implementations on Foreign Types§

Source§

impl<T: ItemDesc + ?Sized> ItemDesc for &T

Source§

fn description(&self) -> &str

👎Deprecated: since item i18n
Source§

fn name(&self) -> Cow<'_, str>

👎Deprecated: since item i18n
Source§

fn kind(&self) -> Cow<'_, ItemKind>

Source§

fn amount(&self) -> NonZeroU32

Source§

fn quality(&self) -> Quality

Source§

fn num_slots(&self) -> u16

Source§

fn item_definition_id(&self) -> ItemDefinitionId<'_>

Source§

fn tags(&self) -> Vec<ItemTag>

Source§

fn is_modular(&self) -> bool

Source§

fn components(&self) -> &[Item]

Source§

fn has_durability(&self) -> bool

Source§

fn durability_lost(&self) -> Option<u32>

Source§

fn stats_durability_multiplier(&self) -> DurabilityMultiplier

Implementors§