Trait legion::query::View [−][src]
A type which can pull entity data out of a world.
Associated Types
type Element: Send + Sync + 'data
[src]
The type of component references returned.
type Fetch: Fetch + IntoIndexableIter<Item = Self::Element> + 'data
[src]
The fetch type yielded for each archetype.
type Iter: Iterator<Item = Option<Self::Fetch>> + 'data
[src]
The iterator type which pulls entity data out of a world.
type Read: AsRef<[ComponentTypeId]>
[src]
Contains the type IDs read by the view.
type Write: AsRef<[ComponentTypeId]>
[src]
Contains the type IDs written by the view.
Required methods
unsafe fn fetch(
components: &'data Components,
archetypes: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
[src]
components: &'data Components,
archetypes: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
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.
fn validate()
[src]
Determines if this view type is valid. Panics if checks fail.
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
Returns true
if the given component access includes all permissions required by the view.
fn reads_types() -> Self::Read
[src]
Returns the component types read by the view.
fn writes_types() -> Self::Write
[src]
Returns the component types written to by the view.
fn reads<T: Component>() -> bool
[src]
Returns true
if the view reads the specified data type.
fn writes<T: Component>() -> bool
[src]
Returns true
if the view writes to the specified data type.
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
Returns a permissions struct declaring the component accesses required by the view.
Implementations on Foreign Types
impl<'a, A: View<'a> + 'a, B: View<'a> + 'a, C: View<'a> + 'a, D: View<'a> + 'a, E: View<'a> + 'a, F: View<'a> + 'a, G: View<'a> + 'a, H: View<'a> + 'a> View<'a> for (A, B, C, D, E, F, G, H)
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = MultiFetch<'a, (A::Fetch, B::Fetch, C::Fetch, D::Fetch, E::Fetch, F::Fetch, G::Fetch, H::Fetch)>
type Iter = MapInto<Zip<(A::Iter, B::Iter, C::Iter, D::Iter, E::Iter, F::Iter, G::Iter, H::Iter)>, Option<MultiFetch<'a, (A::Fetch, B::Fetch, C::Fetch, D::Fetch, E::Fetch, F::Fetch, G::Fetch, H::Fetch)>>>
type Read = Vec<ComponentTypeId>
type Write = Vec<ComponentTypeId>
unsafe fn fetch(
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
[src]
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
fn reads<Comp: Component>() -> bool
[src]
fn writes<Comp: Component>() -> bool
[src]
impl<'a, B: View<'a> + 'a, C: View<'a> + 'a, D: View<'a> + 'a, E: View<'a> + 'a, F: View<'a> + 'a, G: View<'a> + 'a, H: View<'a> + 'a> View<'a> for (B, C, D, E, F, G, H)
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = MultiFetch<'a, (B::Fetch, C::Fetch, D::Fetch, E::Fetch, F::Fetch, G::Fetch, H::Fetch)>
type Iter = MapInto<Zip<(B::Iter, C::Iter, D::Iter, E::Iter, F::Iter, G::Iter, H::Iter)>, Option<MultiFetch<'a, (B::Fetch, C::Fetch, D::Fetch, E::Fetch, F::Fetch, G::Fetch, H::Fetch)>>>
type Read = Vec<ComponentTypeId>
type Write = Vec<ComponentTypeId>
unsafe fn fetch(
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
[src]
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
fn reads<Comp: Component>() -> bool
[src]
fn writes<Comp: Component>() -> bool
[src]
impl<'a, C: View<'a> + 'a, D: View<'a> + 'a, E: View<'a> + 'a, F: View<'a> + 'a, G: View<'a> + 'a, H: View<'a> + 'a> View<'a> for (C, D, E, F, G, H)
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = MultiFetch<'a, (C::Fetch, D::Fetch, E::Fetch, F::Fetch, G::Fetch, H::Fetch)>
type Iter = MapInto<Zip<(C::Iter, D::Iter, E::Iter, F::Iter, G::Iter, H::Iter)>, Option<MultiFetch<'a, (C::Fetch, D::Fetch, E::Fetch, F::Fetch, G::Fetch, H::Fetch)>>>
type Read = Vec<ComponentTypeId>
type Write = Vec<ComponentTypeId>
unsafe fn fetch(
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
[src]
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
fn reads<Comp: Component>() -> bool
[src]
fn writes<Comp: Component>() -> bool
[src]
impl<'a, D: View<'a> + 'a, E: View<'a> + 'a, F: View<'a> + 'a, G: View<'a> + 'a, H: View<'a> + 'a> View<'a> for (D, E, F, G, H)
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = MultiFetch<'a, (D::Fetch, E::Fetch, F::Fetch, G::Fetch, H::Fetch)>
type Iter = MapInto<Zip<(D::Iter, E::Iter, F::Iter, G::Iter, H::Iter)>, Option<MultiFetch<'a, (D::Fetch, E::Fetch, F::Fetch, G::Fetch, H::Fetch)>>>
type Read = Vec<ComponentTypeId>
type Write = Vec<ComponentTypeId>
unsafe fn fetch(
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
[src]
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
fn reads<Comp: Component>() -> bool
[src]
fn writes<Comp: Component>() -> bool
[src]
impl<'a, E: View<'a> + 'a, F: View<'a> + 'a, G: View<'a> + 'a, H: View<'a> + 'a> View<'a> for (E, F, G, H)
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = MultiFetch<'a, (E::Fetch, F::Fetch, G::Fetch, H::Fetch)>
type Iter = MapInto<Zip<(E::Iter, F::Iter, G::Iter, H::Iter)>, Option<MultiFetch<'a, (E::Fetch, F::Fetch, G::Fetch, H::Fetch)>>>
type Read = Vec<ComponentTypeId>
type Write = Vec<ComponentTypeId>
unsafe fn fetch(
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
[src]
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
fn reads<Comp: Component>() -> bool
[src]
fn writes<Comp: Component>() -> bool
[src]
impl<'a, F: View<'a> + 'a, G: View<'a> + 'a, H: View<'a> + 'a> View<'a> for (F, G, H)
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = MultiFetch<'a, (F::Fetch, G::Fetch, H::Fetch)>
type Iter = MapInto<Zip<(F::Iter, G::Iter, H::Iter)>, Option<MultiFetch<'a, (F::Fetch, G::Fetch, H::Fetch)>>>
type Read = Vec<ComponentTypeId>
type Write = Vec<ComponentTypeId>
unsafe fn fetch(
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
[src]
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
fn reads<Comp: Component>() -> bool
[src]
fn writes<Comp: Component>() -> bool
[src]
impl<'a, G: View<'a> + 'a, H: View<'a> + 'a> View<'a> for (G, H)
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = MultiFetch<'a, (G::Fetch, H::Fetch)>
type Iter = MapInto<Zip<(G::Iter, H::Iter)>, Option<MultiFetch<'a, (G::Fetch, H::Fetch)>>>
type Read = Vec<ComponentTypeId>
type Write = Vec<ComponentTypeId>
unsafe fn fetch(
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
[src]
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
fn reads<Comp: Component>() -> bool
[src]
fn writes<Comp: Component>() -> bool
[src]
impl<'a, H: View<'a> + 'a> View<'a> for (H,)
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = MultiFetch<'a, (H::Fetch,)>
type Iter = MapInto<Zip<(H::Iter,)>, Option<MultiFetch<'a, (H::Fetch,)>>>
type Read = Vec<ComponentTypeId>
type Write = Vec<ComponentTypeId>
unsafe fn fetch(
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
[src]
components: &'a Components,
archetypes: &'a [Archetype],
query: QueryResult<'a>
) -> Self::Iter
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
fn reads<Comp: Component>() -> bool
[src]
fn writes<Comp: Component>() -> bool
[src]
Implementors
impl<'data> View<'data> for Entity
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = EntityFetch<'data>
type Iter = Iter<'data>
type Read = [ComponentTypeId; 0]
type Write = [ComponentTypeId; 0]
fn validate()
[src]
fn validate_access(_: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn reads<D: Component>() -> bool
[src]
fn writes<D: Component>() -> bool
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
unsafe fn fetch(
_: &'data Components,
archetypes: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
[src]
_: &'data Components,
archetypes: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
impl<'data, T: Component> View<'data> for Read<T>
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = ReadFetch<'data, T>
type Iter = ReadIter<'data, T>
type Read = [ComponentTypeId; 1]
type Write = [ComponentTypeId; 0]
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn reads<D: Component>() -> bool
[src]
fn writes<D: Component>() -> bool
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
unsafe fn fetch(
components: &'data Components,
_: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
[src]
components: &'data Components,
_: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
impl<'data, T: Component> View<'data> for TryRead<T>
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = Slice<'data, T>
type Iter = TryReadIter<'data, T>
type Read = [ComponentTypeId; 1]
type Write = [ComponentTypeId; 0]
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn reads<D: Component>() -> bool
[src]
fn writes<D: Component>() -> bool
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
unsafe fn fetch(
components: &'data Components,
archetypes: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
[src]
components: &'data Components,
archetypes: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
impl<'data, T: Component> View<'data> for TryWrite<T>
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = Slice<'data, T>
type Iter = TryWriteIter<'data, T>
type Read = [ComponentTypeId; 1]
type Write = [ComponentTypeId; 1]
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn reads<D: Component>() -> bool
[src]
fn writes<D: Component>() -> bool
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
unsafe fn fetch(
components: &'data Components,
archetypes: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
[src]
components: &'data Components,
archetypes: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
impl<'data, T: Component> View<'data> for Write<T>
[src]
type Element = <Self::Fetch as IntoIndexableIter>::Item
type Fetch = WriteFetch<'data, T>
type Iter = WriteIter<'data, T>
type Read = [ComponentTypeId; 1]
type Write = [ComponentTypeId; 1]
fn validate()
[src]
fn validate_access(access: &ComponentAccess<'_>) -> bool
[src]
fn reads_types() -> Self::Read
[src]
fn writes_types() -> Self::Write
[src]
fn reads<D: Component>() -> bool
[src]
fn writes<D: Component>() -> bool
[src]
fn requires_permissions() -> Permissions<ComponentTypeId>
[src]
unsafe fn fetch(
components: &'data Components,
_: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter
[src]
components: &'data Components,
_: &'data [Archetype],
query: QueryResult<'data>
) -> Self::Iter