Struct shipyard::View [−][src]
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 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
- Storage does not track deletion. Start tracking by calling
track_deletion
ortrack_all
.
pub fn removed(&self) -> &[EntityId]
[src]
Returns the ids of removed components of a storage tracking removal.
Panics
- Storage does not track removal. Start tracking by calling
track_removal
ortrack_all
.
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
- Storage does not track removal nor deletion. Start tracking by calling
track_removal
,track_deletion
ortrack_all
.
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]
fn borrow_info(infos: &mut Vec<TypeInfo>)
[src]
impl<'a, T> Clone for View<'a, T>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[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.
fn deref(&self) -> &Self::Target
[src]
impl<'a: 'b, 'b, T: 'static> Get for &'b View<'a, T>
[src]
type Out = &'b T
type FastOut = &'b T
fn get(self, entity: EntityId) -> Result<Self::Out, MissingComponent>
[src]
fn fast_get(self, entity: EntityId) -> Result<Self::FastOut, MissingComponent>
[src]
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]
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for View<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> Send for View<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Sync for View<'a, T> where
T: Sync,
T: Sync,
impl<'a, T> Unpin for View<'a, T>
impl<'a, T> UnwindSafe for View<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,