pub trait View<'data>: DefaultFilter + Sized {
    type Element: Send + Sync + 'data;
    type Fetch: Fetch + IntoIndexableIter<Item = Self::Element> + 'data;
    type Iter: Iterator<Item = Option<Self::Fetch>> + 'data;
    type Read: AsRef<[ComponentTypeId]>;
    type Write: AsRef<[ComponentTypeId]>;
    unsafe fn fetch(
        components: &'data Components,
        archetypes: &'data [Archetype],
        query: QueryResult<'data>
    ) -> Self::Iter;
fn validate();
fn validate_access(access: &ComponentAccess<'_>) -> bool;
fn reads_types() -> Self::Read;
fn writes_types() -> Self::Write;
fn reads<T: Component>() -> bool;
fn writes<T: Component>() -> bool;
fn requires_permissions() -> Permissions<ComponentTypeId>; }
Expand description

A type which can pull entity data out of a world.

Associated Types

The type of component references returned.

The fetch type yielded for each archetype.

The iterator type which pulls entity data out of a world.

Contains the type IDs read by the view.

Contains the type IDs written by the view.

Required methods

Creates an iterator which will yield slices of entity data for each archetype.

Safety

This method may return mutable references to entity data via shared world references. The caller must ensure that no two view iterators are alive at the same time which access any components in a manner which may cause mutable aliasing.

Determines if this view type is valid. Panics if checks fail.

Returns true if the given component access includes all permissions required by the view.

Returns the component types read by the view.

Returns the component types written to by the view.

Returns true if the view reads the specified data type.

Returns true if the view writes to the specified data type.

Returns a permissions struct declaring the component accesses required by the view.

Implementations on Foreign Types

Implementors