pub struct InventoryTickContext<'a> {
pub world: &'a Arc<World>,
pub owner: &'a dyn Entity,
pub slot: Option<EquipmentSlot>,
item: ItemRef,
source: InventoryTickSource<'a>,
}Expand description
Context for an item inventory tick
Fields§
§world: &'a Arc<World>The current world
owner: &'a dyn EntityThe entity carrying the item
slot: Option<EquipmentSlot>None if the slot is not selected and or in the main player inventory
item: ItemRef§source: InventoryTickSource<'a>Implementations§
Source§impl<'a> InventoryTickContext<'a>
impl<'a> InventoryTickContext<'a>
pub(crate) fn tick_player_inventory(world: &'a Arc<World>, player: &'a Player)
pub(crate) fn tick_equipment( world: &'a Arc<World>, owner: &'a dyn LivingEntity, slots: impl IntoIterator<Item = EquipmentSlot>, )
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for InventoryTickContext<'a>
impl<'a> !UnwindSafe for InventoryTickContext<'a>
impl<'a> Freeze for InventoryTickContext<'a>
impl<'a> Send for InventoryTickContext<'a>
impl<'a> Sync for InventoryTickContext<'a>
impl<'a> Unpin for InventoryTickContext<'a>
impl<'a> UnsafeUnpin for InventoryTickContext<'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
§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<>>