pub struct Ref<'a, C>where
C: Component,{ /* private fields */ }Available on crate feature
ecs only.Expand description
The QueryParameter for getting a reference to a Component
Implementations§
Trait Implementations§
Source§impl<C> QueryParameter for Ref<'_, C>where
C: Component,
impl<C> QueryParameter for Ref<'_, C>where
C: Component,
Source§type ComponentContainerLock<'a> = Option<MappedRwLockReadGuard<'a, RawRwLock, ComponentContainer<C>>>
type ComponentContainerLock<'a> = Option<MappedRwLockReadGuard<'a, RawRwLock, ComponentContainer<C>>>
The lock returned from
QueryParameter::lockSource§type ComponentContainer<'a> = Option<&'a ComponentContainer<C>>
type ComponentContainer<'a> = Option<&'a ComponentContainer<C>>
The component container that is used to get
Components fromSource§fn lock<'a>(
state: &SystemRunState<'a>,
) -> <Ref<'_, C> as QueryParameter>::ComponentContainerLock<'a>
fn lock<'a>( state: &SystemRunState<'a>, ) -> <Ref<'_, C> as QueryParameter>::ComponentContainerLock<'a>
Locks any needed state, the first step to creating a
QuerySource§fn construct<'a>(
lock: &'a mut <Ref<'_, C> as QueryParameter>::ComponentContainerLock<'_>,
) -> <Ref<'_, C> as QueryParameter>::ComponentContainer<'a>
fn construct<'a>( lock: &'a mut <Ref<'_, C> as QueryParameter>::ComponentContainerLock<'_>, ) -> <Ref<'_, C> as QueryParameter>::ComponentContainer<'a>
Constructs the component container from the locked state, the final state to creating a
QuerySource§fn get_component_types() -> impl Iterator<Item = Borrow>
fn get_component_types() -> impl Iterator<Item = Borrow>
Returns an iterator over all the
Component types that will be lockedAuto Trait Implementations§
impl<'a, C> Freeze for Ref<'a, C>
impl<'a, C> RefUnwindSafe for Ref<'a, C>where
C: RefUnwindSafe,
impl<'a, C> Send for Ref<'a, C>
impl<'a, C> Sync for Ref<'a, C>
impl<'a, C> Unpin for Ref<'a, C>
impl<'a, C> UnwindSafe for Ref<'a, C>where
C: RefUnwindSafe,
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> 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 more