Struct keeshond::scene::ComponentStore [−][src]
pub struct ComponentStore<C: Component + 'static> { /* fields omitted */ }
Expand description
Implementations
Returns an immutable reference to the “n-th” Component in the store. This is primarily useful for when you want to get the first, last, or random component, etc. The index you use here should not be cached, as the components may move around in the store. In most cases you should use [get_entity()] instead.
Returns a mutable reference to the “n-th” Component in the store. This is primarily useful for when you want to get the first, last, or random component, etc. The index you use here should not be cached, as the components may move around in the store. In most cases you should use [get_entity_mut()] instead.
pub fn iter(&self) -> ComponentIter<'_, C>ⓘNotable traits for ComponentIter<'a, C>impl<'a, C: Component + 'static> Iterator for ComponentIter<'a, C> type Item = (Entity, &'a C);
pub fn iter(&self) -> ComponentIter<'_, C>ⓘNotable traits for ComponentIter<'a, C>impl<'a, C: Component + 'static> Iterator for ComponentIter<'a, C> type Item = (Entity, &'a C);
impl<'a, C: Component + 'static> Iterator for ComponentIter<'a, C> type Item = (Entity, &'a C);
Returns a ComponentIter that iterates through all Components in the store. Typically used in a DrawerSystem.
pub fn iter_mut(&mut self) -> ComponentIterMut<'_, C>ⓘNotable traits for ComponentIterMut<'a, C>impl<'a, C: Component + 'static> Iterator for ComponentIterMut<'a, C> type Item = (Entity, &'a mut C);
pub fn iter_mut(&mut self) -> ComponentIterMut<'_, C>ⓘNotable traits for ComponentIterMut<'a, C>impl<'a, C: Component + 'static> Iterator for ComponentIterMut<'a, C> type Item = (Entity, &'a mut C);
impl<'a, C: Component + 'static> Iterator for ComponentIterMut<'a, C> type Item = (Entity, &'a mut C);
Returns a ComponentIterMut that iterates through all Components in the store. Typically used in a ThinkerSystem.
Trait Implementations
Auto Trait Implementations
impl<C> RefUnwindSafe for ComponentStore<C> where
C: RefUnwindSafe,
impl<C> Send for ComponentStore<C> where
C: Send,
impl<C> Sync for ComponentStore<C> where
C: Sync,
impl<C> Unpin for ComponentStore<C> where
C: Unpin,
impl<C> UnwindSafe for ComponentStore<C> where
C: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more