pub struct ImplicitComponentGetter<'a> {
stack: &'a ItemStack,
consumed: FxHashSet<Identifier>,
}Expand description
Reads effective item components and tracks which ones are represented by entity fields, excluding them from the stored component map.
Fields§
§stack: &'a ItemStack§consumed: FxHashSet<Identifier>Implementations§
Source§impl<'a> ImplicitComponentGetter<'a>
impl<'a> ImplicitComponentGetter<'a>
pub(super) fn new(stack: &'a ItemStack) -> Self
Sourcepub fn get<T: Component + DowncastType + Clone>(
&mut self,
component: DataComponentType<T>,
) -> Option<T>
pub fn get<T: Component + DowncastType + Clone>( &mut self, component: DataComponentType<T>, ) -> Option<T>
Reads a component from the placed stack and marks it implicit.
Sourcepub fn get_or_default<T: Component + DowncastType + Clone>(
&mut self,
component: DataComponentType<T>,
default: T,
) -> T
pub fn get_or_default<T: Component + DowncastType + Clone>( &mut self, component: DataComponentType<T>, default: T, ) -> T
Reads a component from the placed stack, falling back to default, and marks it implicit.
Sourcepub(super) fn remaining_stored_components(self) -> DataComponentMap
pub(super) fn remaining_stored_components(self) -> DataComponentMap
Returns patched components that were set and not read into entity fields.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for ImplicitComponentGetter<'a>
impl<'a> !UnwindSafe for ImplicitComponentGetter<'a>
impl<'a> Freeze for ImplicitComponentGetter<'a>
impl<'a> Send for ImplicitComponentGetter<'a>
impl<'a> Sync for ImplicitComponentGetter<'a>
impl<'a> Unpin for ImplicitComponentGetter<'a>
impl<'a> UnsafeUnpin for ImplicitComponentGetter<'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<>>