pub trait IsQuery {
type LockedColumns<'a>;
type ExtensionColumns: 'static;
type QueryResult<'a>: Iterator<Item = Self::QueryRow<'a>>;
type ParQueryResult<'a>: ParallelIterator<Item = Self::QueryRow<'a>> + IndexedParallelIterator;
type QueryRow<'a>: Send + Sync;
fn borrows() -> Vec<Borrow>;
fn lock_columns<'a>(arch: &'a Archetype) -> Self::LockedColumns<'a>;
fn extend_locked_columns<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>,
extension_columns: Self::ExtensionColumns,
output_ids: Option<(&mut Vec<usize>, &mut usize)>
);
fn iter_mut<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>
) -> Self::QueryResult<'b>;
fn iter_one<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>,
index: usize
) -> Self::QueryResult<'b>;
fn par_iter_mut<'a, 'b>(
len: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>;
}
Expand description
Denotes the shape of a query that can be used to iterate over bundles of components.
Required Associated Types
sourcetype LockedColumns<'a>
type LockedColumns<'a>
Data that is read or write locked by performing this query.
sourcetype ExtensionColumns: 'static
type ExtensionColumns: 'static
Data that can be used to append to columns. Typically vectors of component entries or bundles of vectors of component entries.
sourcetype QueryResult<'a>: Iterator<Item = Self::QueryRow<'a>>
type QueryResult<'a>: Iterator<Item = Self::QueryRow<'a>>
The iterator that is produced by performing a query on one archetype.
sourcetype ParQueryResult<'a>: ParallelIterator<Item = Self::QueryRow<'a>> + IndexedParallelIterator
type ParQueryResult<'a>: ParallelIterator<Item = Self::QueryRow<'a>> + IndexedParallelIterator
The parallel iterator that is produced by performing a query on one archetype.
Required Methods
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>(
lock: &'b mut Self::LockedColumns<'a>,
extension_columns: Self::ExtensionColumns,
output_ids: Option<(&mut Vec<usize>, &mut usize)>
)
fn extend_locked_columns<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>,
extension_columns: Self::ExtensionColumns,
output_ids: Option<(&mut Vec<usize>, &mut usize)>
)
Extend entries in the locked columns.
This is for internal use only.
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.
Implementations on Foreign Types
sourceimpl<'s, T: Send + Sync + 'static> IsQuery for &'s T
impl<'s, T: Send + Sync + 'static> IsQuery for &'s T
sourcefn par_iter_mut<'a, 'b>(
_: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>
fn par_iter_mut<'a, 'b>(
_: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>
Create an iterator over the rows of the given columns.
type LockedColumns<'a> = Option<RwLockReadGuard<'a, RawRwLock, AnyVec<dyn Sync + Send + 'static, Heap>>>
type ExtensionColumns = ()
type QueryResult<'a> = Iter<'a, Entry<T>>
type ParQueryResult<'a> = Iter<'a, Entry<T>>
type QueryRow<'a> = &'a Entry<T>
fn borrows() -> Vec<Borrow>
fn lock_columns<'t>(arch: &'t Archetype) -> Self::LockedColumns<'t>
fn extend_locked_columns<'a, 'b>(
_: &'b mut Self::LockedColumns<'a>,
(): Self::ExtensionColumns,
_: Option<(&mut Vec<usize>, &mut usize)>
)
fn iter_mut<'a, 'b>(
locked: &'b mut Self::LockedColumns<'a>
) -> Self::QueryResult<'b>
fn iter_one<'a, 'b>(
lock: &'b mut Self::LockedColumns<'a>,
index: usize
) -> Self::QueryResult<'b>
sourceimpl<'s, T: Send + Sync + 'static> IsQuery for &'s mut T
impl<'s, T: Send + Sync + 'static> IsQuery for &'s mut T
sourcefn par_iter_mut<'a, 'b>(
_: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>
fn par_iter_mut<'a, 'b>(
_: usize,
lock: &'b mut Self::LockedColumns<'a>
) -> Self::ParQueryResult<'b>
Create an iterator over the rows of the given columns.