Struct oc_wasm_helpers::inventory::ItemStack
source · [−]pub struct ItemStack<'buffer> {
pub name: &'buffer str,
pub label: &'buffer str,
pub size: u32,
pub max_size: u32,
pub damage: u32,
pub max_damage: u32,
pub has_tag: bool,
}Expand description
Information about an item stack.
The 'buffer lifetime is the lifetime of the buffer holding strings to which the object
refers.
Fields
name: &'buffer strThe internal (Minecraft system) name of the item.
For example, this might be minecraft:cobblestone.
label: &'buffer strThe human-readable name of the item.
For example, this might be Cobblestone.
size: u32The number of items in the stack.
max_size: u32The maximum number of items that can be held in the stack.
damage: u32The damage value of the item, if it is a tool, or zero if not.
max_damage: u32The damage value at which the item breaks, if it is a tool, or zero if not.
has_tag: boolWhether the item has extra NBT data attached.
Trait Implementations
sourceimpl<'buffer> Ord for ItemStack<'buffer>
impl<'buffer> Ord for ItemStack<'buffer>
sourceimpl<'buffer> PartialOrd<ItemStack<'buffer>> for ItemStack<'buffer>
impl<'buffer> PartialOrd<ItemStack<'buffer>> for ItemStack<'buffer>
sourcefn partial_cmp(&self, other: &ItemStack<'buffer>) -> Option<Ordering>
fn partial_cmp(&self, other: &ItemStack<'buffer>) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl<'buffer> Eq for ItemStack<'buffer>
impl<'buffer> StructuralEq for ItemStack<'buffer>
impl<'buffer> StructuralPartialEq for ItemStack<'buffer>
Auto Trait Implementations
impl<'buffer> RefUnwindSafe for ItemStack<'buffer>
impl<'buffer> Send for ItemStack<'buffer>
impl<'buffer> Sync for ItemStack<'buffer>
impl<'buffer> Unpin for ItemStack<'buffer>
impl<'buffer> UnwindSafe for ItemStack<'buffer>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more