pub struct EntityEquipmentRef<'a>(&'a EntityEquipmentSlots);Expand description
Every equipment slot of a living entity.
Tuple Fields§
§0: &'a EntityEquipmentSlotsImplementations§
Source§impl<'a> EntityEquipmentRef<'a>
impl<'a> EntityEquipmentRef<'a>
pub const fn new(slots: &'a EntityEquipmentSlots) -> Self
Sourcepub const fn get(self, slot: EquipmentSlot) -> &'a ItemStack
pub const fn get(self, slot: EquipmentSlot) -> &'a ItemStack
Returns the item in the given equipment slot.
Sourcepub fn get_enchantment_level(self, enchantment: &Identifier) -> i32
pub fn get_enchantment_level(self, enchantment: &Identifier) -> i32
Returns the highest enchantment level from matching equipment slots.
Trait Implementations§
Source§impl<'a> Clone for EntityEquipmentRef<'a>
impl<'a> Clone for EntityEquipmentRef<'a>
impl<'a> Copy for EntityEquipmentRef<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EntityEquipmentRef<'a>
impl<'a> !UnwindSafe for EntityEquipmentRef<'a>
impl<'a> Freeze for EntityEquipmentRef<'a>
impl<'a> Send for EntityEquipmentRef<'a>
impl<'a> Sync for EntityEquipmentRef<'a>
impl<'a> Unpin for EntityEquipmentRef<'a>
impl<'a> UnsafeUnpin for EntityEquipmentRef<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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<>>