Struct shipyard::View[][src]

pub struct View<'a, T> { /* fields omitted */ }

Shared view over a component storage.

Implementations

impl<T> View<'_, T>[src]

pub fn inserted(&self) -> Inserted<&Self>[src]

Wraps this view to be able to iterate inserted components.

pub fn modified(&self) -> Modified<&Self>[src]

Wraps this view to be able to iterate modified components.

pub fn inserted_or_modified(&self) -> InsertedOrModified<&Self>[src]

Wraps this view to be able to iterate inserted and modified components.

Methods from Deref<Target = SparseSet<T>>

pub fn as_slice(&self) -> &[T][src]

Returns a slice of all the components in this storage.

pub fn contains(&self, entity: EntityId) -> bool[src]

Returns true if entity owns a component in this storage.

pub fn len(&self) -> usize[src]

Returns the length of the storage.

pub fn is_empty(&self) -> bool[src]

Returns true if the storage’s length is 0.

pub fn index_of(&self, entity: EntityId) -> Option<usize>[src]

Returns the index of entity’s component in the dense and data vectors.
This index is only valid for this storage and until a modification happens.

pub unsafe fn index_of_unchecked(&self, entity: EntityId) -> usize[src]

Returns the index of entity’s component in the dense and data vectors.
This index is only valid for this storage and until a modification happens.

Safety

entity has to own a component of this type.
The index is only valid until a modification occurs in the storage.

pub fn id_at(&self, index: usize) -> Option<EntityId>[src]

Returns the EntityId at a given index.

pub fn is_inserted(&self, entity: EntityId) -> bool[src]

Returns true if entity’s component was inserted since the last clear_inserted or clear_all_inserted call.
Returns false if entity does not have a component in this storage.

pub fn is_modified(&self, entity: EntityId) -> bool[src]

Returns true if entity’s component was modified since the last clear_modified or clear_all_modified call.
Returns false if entity does not have a component in this storage.

pub fn is_inserted_or_modified(&self, entity: EntityId) -> bool[src]

Returns true if entity’s component was inserted or modified since the last clear call.
Returns false if entity does not have a component in this storage.

pub fn deleted(&self) -> &[(EntityId, T)][src]

Returns the deleted components of a storage tracking deletion.

Panics

pub fn removed(&self) -> &[EntityId][src]

Returns the ids of removed components of a storage tracking removal.

Panics

pub fn removed_or_deleted(&self) -> impl Iterator<Item = EntityId> + '_[src]

Returns the ids of removed or deleted components of a storage tracking removal and/or deletion.

Panics

pub fn is_tracking_insertion(&self) -> bool[src]

Returns true if the storage tracks insertion.

pub fn is_tracking_modification(&self) -> bool[src]

Returns true if the storage tracks modification.

pub fn is_tracking_deletion(&self) -> bool[src]

Returns true if the storage tracks deletion.

pub fn is_tracking_removal(&self) -> bool[src]

Returns true if the storage tracks removal.

pub fn is_tracking_any(&self) -> bool[src]

Returns true if the storage tracks insertion, modification, deletion or removal.

Trait Implementations

impl<'a, T> AsRef<SparseSet<T>> for View<'a, T>[src]

impl<'a, T: 'static + Send + Sync> BorrowInfo for View<'a, T>[src]

impl<'a, T> Clone for View<'a, T>[src]

impl<'a: 'b, 'b, T: 'static> Contains for &'b View<'a, T>[src]

impl<'a, T> Deref for View<'a, T>[src]

type Target = SparseSet<T>

The resulting type after dereferencing.

impl<'a: 'b, 'b, T: 'static> Get for &'b View<'a, T>[src]

type Out = &'b T

type FastOut = &'b T

impl<T: 'static + Send + Sync> IntoBorrow for View<'_, T>[src]

type Borrow = ViewBorrower<T>

Helper type almost allowing GAT on stable.

impl<T> Not for &View<'_, T>[src]

type Output = Not<Self>

The resulting type after applying the ! operator.

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for View<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for View<'a, T> where
    T: Sync

impl<'a, T> Sync for View<'a, T> where
    T: Sync

impl<'a, T> Unpin for View<'a, T>

impl<'a, T> UnwindSafe for View<'a, T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.