pub struct OwnedEntityEquipment {
slots: [ItemStack; 8],
}Expand description
Owned equipment storage used by non-player living entities.
Fields§
§slots: [ItemStack; 8]Implementations§
Trait Implementations§
Source§impl Default for OwnedEntityEquipment
impl Default for OwnedEntityEquipment
Source§impl EntityEquipment for OwnedEntityEquipment
impl EntityEquipment for OwnedEntityEquipment
Source§fn get_ref(&self, slot: EquipmentSlot) -> &ItemStack
fn get_ref(&self, slot: EquipmentSlot) -> &ItemStack
Gets a reference to the item in a slot.
Source§fn get_mut(&mut self, slot: EquipmentSlot) -> &mut ItemStack
fn get_mut(&mut self, slot: EquipmentSlot) -> &mut ItemStack
Gets a mutable reference to the item in a slot.
Source§fn set(&mut self, slot: EquipmentSlot, stack: ItemStack) -> ItemStack
fn set(&mut self, slot: EquipmentSlot, stack: ItemStack) -> ItemStack
Sets the item in a slot, returning the old item.
Source§fn take(&mut self, slot: EquipmentSlot) -> ItemStack
fn take(&mut self, slot: EquipmentSlot) -> ItemStack
Takes the item from a slot, leaving an empty stack in its place.
Source§fn non_empty_items(&self) -> Vec<(EquipmentSlot, ItemStack)>
fn non_empty_items(&self) -> Vec<(EquipmentSlot, ItemStack)>
Returns non-empty equipment slots for initial spawn synchronization.
Auto Trait Implementations§
impl !RefUnwindSafe for OwnedEntityEquipment
impl !UnwindSafe for OwnedEntityEquipment
impl Freeze for OwnedEntityEquipment
impl Send for OwnedEntityEquipment
impl Sync for OwnedEntityEquipment
impl Unpin for OwnedEntityEquipment
impl UnsafeUnpin for OwnedEntityEquipment
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>