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) -> NonZero<u32>; 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§

fn description(&self) -> &str

👎Deprecated: since item i18n

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

👎Deprecated: since item i18n

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

fn amount(&self) -> NonZero<u32>

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)

Return name’s and description’s localization descriptors

Implementations on Foreign Types§

§

impl<'a, T> ItemDesc for &'a T
where T: ItemDesc + ?Sized,

§

fn description(&self) -> &str

👎Deprecated: since item i18n
§

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

👎Deprecated: since item i18n
§

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

§

fn amount(&self) -> NonZero<u32>

§

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

Implementors§