pub trait Fetch:
IntoIndexableIter
+ Send
+ Sync {
type Data;
// Required methods
fn into_components(self) -> Self::Data;
fn find<T>(&self) -> Option<&[T]>
where T: 'static;
fn find_mut<T>(&mut self) -> Option<&mut [T]>
where T: 'static;
fn version<T>(&self) -> Option<u64>
where T: Component;
fn accepted(&mut self);
}
Expand description
A type which holds onto a slice of entity data retrieved from a single archetype.
Required Associated Types§
Required Methods§
Sourcefn into_components(self) -> Self::Data
fn into_components(self) -> Self::Data
Converts the fetch into the retrieved component slices
Sourcefn find<T>(&self) -> Option<&[T]>where
T: 'static,
fn find<T>(&self) -> Option<&[T]>where
T: 'static,
Tries to find a slice of components, if this fetch contains the requested component type.
Sourcefn find_mut<T>(&mut self) -> Option<&mut [T]>where
T: 'static,
fn find_mut<T>(&mut self) -> Option<&mut [T]>where
T: 'static,
Tries to find a mutable slice of components, if this fetch contains the requested component type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.