Trait Fetch

Source
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§

Source

type Data

The inner data representation fetched from the archetype. Typically a slice reference.

Required Methods§

Source

fn into_components(self) -> Self::Data

Converts the fetch into the retrieved component slices

Source

fn find<T>(&self) -> Option<&[T]>
where T: 'static,

Tries to find a slice of components, if this fetch contains the requested component type.

Source

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.

Source

fn version<T>(&self) -> Option<u64>
where T: Component,

Tries to find the component slice version of a component, if this fetch contains the requested component type.

Source

fn accepted(&mut self)

Indicates that the archetype is going to be provided to the user. Component slice versions are incremented here.

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.

Implementors§