pub struct Maybe<T>(_);Expand description
Query type used to denote an optional column.
Use Maybe in queries to return bundles of components that may or may not
contain a component of the wrapped type T.
Trait Implementations
sourceimpl<'s, T: Send + Sync + 'static> IsQuery for Maybe<&'s T>
impl<'s, T: Send + Sync + 'static> IsQuery for Maybe<&'s T>
type LockedColumns<'a> = Option<RwLockReadGuard<'a, RawRwLock, AnyVec<dyn Send + Sync + 'static, Heap>>>
type LockedColumns<'a> = Option<RwLockReadGuard<'a, RawRwLock, AnyVec<dyn Send + Sync + 'static, Heap>>>
Data that is read or write locked by performing this query.
type ExtensionColumns = ()
type ExtensionColumns = ()
Data that can be used to append to columns. Typically vectors of
component entries or bundles of vectors of component entries. Read more
type QueryResult<'a> = Either<RepeatWith<fn() -> Option<&'a Entry<T>>>, Map<Iter<'a, Entry<T>>, fn(&'r Entry<T>) -> Option<&'r Entry<T>>>>
type QueryResult<'a> = Either<RepeatWith<fn() -> Option<&'a Entry<T>>>, Map<Iter<'a, Entry<T>>, fn(&'r Entry<T>) -> Option<&'r Entry<T>>>>
The iterator that is produced by performing a query on one archetype.
type ParQueryResult<'a> = Either<Map<RepeatN<()>, fn(()) -> Option<&'a Entry<T>>>, Map<Iter<'a, Entry<T>>, fn(&'r Entry<T>) -> Option<&'r Entry<T>>>>
type ParQueryResult<'a> = Either<Map<RepeatN<()>, fn(()) -> Option<&'a Entry<T>>>, Map<Iter<'a, Entry<T>>, fn(&'r Entry<T>) -> Option<&'r Entry<T>>>>
The parallel iterator that is produced by performing a query on one
archetype. Read more
fn borrows() -> Vec<Borrow>
sourcefn lock_columns<'a>(arch: &'a Archetype) -> Self::LockedColumns<'a>
fn lock_columns<'a>(arch: &'a Archetype) -> Self::LockedColumns<'a>
Find and acquire a “lock” on the columns for reading or writing.
sourcefn extend_locked_columns<'a, 'b>(
_: &'b mut Self::LockedColumns<'a>,
_: Self::ExtensionColumns,
_: Option<(&mut Vec<usize>, &mut usize)>
)
fn extend_locked_columns<'a, 'b>(
_: &'b mut Self::LockedColumns<'a>,
_: Self::ExtensionColumns,
_: Option<(&mut Vec<usize>, &mut usize)>
)
Extend entries in the locked columns. Read more
sourcefn iter_mut<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>
) -> Self::QueryResult<'b>
fn iter_mut<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>
) -> Self::QueryResult<'b>
Create an iterator over the rows of the given columns.
sourcefn iter_one<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>,
index: usize
) -> Self::QueryResult<'b>
fn iter_one<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>,
index: usize
) -> Self::QueryResult<'b>
Create an iterator over one row with the given index.
sourcefn par_iter_mut<'a, 'b>(
len: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>
fn par_iter_mut<'a, 'b>(
len: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>
Create an iterator over the rows of the given columns.
sourceimpl<'s, T: Send + Sync + 'static> IsQuery for Maybe<&'s mut T>
impl<'s, T: Send + Sync + 'static> IsQuery for Maybe<&'s mut T>
type LockedColumns<'a> = Option<RwLockWriteGuard<'a, RawRwLock, AnyVec<dyn Send + Sync + 'static, Heap>>>
type LockedColumns<'a> = Option<RwLockWriteGuard<'a, RawRwLock, AnyVec<dyn Send + Sync + 'static, Heap>>>
Data that is read or write locked by performing this query.
type ExtensionColumns = ()
type ExtensionColumns = ()
Data that can be used to append to columns. Typically vectors of
component entries or bundles of vectors of component entries. Read more
type QueryResult<'a> = Either<RepeatWith<fn() -> Option<&'a mut Entry<T>>>, Map<IterMut<'a, Entry<T>>, fn(&'r mut Entry<T>) -> Option<&'r mut Entry<T>>>>
type QueryResult<'a> = Either<RepeatWith<fn() -> Option<&'a mut Entry<T>>>, Map<IterMut<'a, Entry<T>>, fn(&'r mut Entry<T>) -> Option<&'r mut Entry<T>>>>
The iterator that is produced by performing a query on one archetype.
type ParQueryResult<'a> = Either<Map<RepeatN<()>, fn(()) -> Option<&'a mut Entry<T>>>, Map<IterMut<'a, Entry<T>>, fn(&'r mut Entry<T>) -> Option<&'r mut Entry<T>>>>
type ParQueryResult<'a> = Either<Map<RepeatN<()>, fn(()) -> Option<&'a mut Entry<T>>>, Map<IterMut<'a, Entry<T>>, fn(&'r mut Entry<T>) -> Option<&'r mut Entry<T>>>>
The parallel iterator that is produced by performing a query on one
archetype. Read more
fn borrows() -> Vec<Borrow>
sourcefn lock_columns<'a>(arch: &'a Archetype) -> Self::LockedColumns<'a>
fn lock_columns<'a>(arch: &'a Archetype) -> Self::LockedColumns<'a>
Find and acquire a “lock” on the columns for reading or writing.
sourcefn extend_locked_columns<'a, 'b>(
_: &'b mut Self::LockedColumns<'a>,
_: Self::ExtensionColumns,
_: Option<(&mut Vec<usize>, &mut usize)>
)
fn extend_locked_columns<'a, 'b>(
_: &'b mut Self::LockedColumns<'a>,
_: Self::ExtensionColumns,
_: Option<(&mut Vec<usize>, &mut usize)>
)
Extend entries in the locked columns. Read more
sourcefn iter_mut<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>
) -> Self::QueryResult<'b>
fn iter_mut<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>
) -> Self::QueryResult<'b>
Create an iterator over the rows of the given columns.
sourcefn iter_one<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>,
index: usize
) -> Self::QueryResult<'b>
fn iter_one<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>,
index: usize
) -> Self::QueryResult<'b>
Create an iterator over one row with the given index.
sourcefn par_iter_mut<'a, 'b>(
len: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>
fn par_iter_mut<'a, 'b>(
len: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>
Create an iterator over the rows of the given columns.
Auto Trait Implementations
impl<T> RefUnwindSafe for Maybe<T>where
T: RefUnwindSafe,
impl<T> Send for Maybe<T>where
T: Send,
impl<T> Sync for Maybe<T>where
T: Sync,
impl<T> Unpin for Maybe<T>where
T: Unpin,
impl<T> UnwindSafe for Maybe<T>where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more