Struct evenio::component::Components
source · pub struct Components { /* private fields */ }Expand description
Contains metadata for all the components in a world.
This can be obtained in a system by using the &Components system
parameter.
world.add_system(|_: Receiver<E>, components: &Components| {});Implementations§
source§impl Components
impl Components
sourcepub fn get(&self, id: ComponentId) -> Option<&ComponentInfo>
pub fn get(&self, id: ComponentId) -> Option<&ComponentInfo>
Gets the ComponentInfo of the given component. Returns None if the
ID is invalid.
sourcepub fn get_by_index(&self, idx: ComponentIdx) -> Option<&ComponentInfo>
pub fn get_by_index(&self, idx: ComponentIdx) -> Option<&ComponentInfo>
Gets the ComponentInfo for a component using its ComponentIdx.
Returns None if the index is invalid.
sourcepub fn get_by_type_id(&self, type_id: TypeId) -> Option<&ComponentInfo>
pub fn get_by_type_id(&self, type_id: TypeId) -> Option<&ComponentInfo>
Gets the ComponentInfo for a component using its TypeId. Returns
None if the TypeId does not map to a component.
sourcepub fn contains(&self, id: ComponentId) -> bool
pub fn contains(&self, id: ComponentId) -> bool
Does the given component exist in the world?
sourcepub fn iter(&self) -> impl Iterator<Item = &ComponentInfo>
pub fn iter(&self) -> impl Iterator<Item = &ComponentInfo>
Returns an iterator over all component infos.
Trait Implementations§
source§impl Debug for Components
impl Debug for Components
source§impl Index<ComponentId> for Components
impl Index<ComponentId> for Components
§type Output = ComponentInfo
type Output = ComponentInfo
The returned type after indexing.
source§impl Index<ComponentIdx> for Components
impl Index<ComponentIdx> for Components
§type Output = ComponentInfo
type Output = ComponentInfo
The returned type after indexing.
source§impl Index<TypeId> for Components
impl Index<TypeId> for Components
source§impl SystemParam for &Components
impl SystemParam for &Components
§type Item<'a> = &'a Components
type Item<'a> = &'a Components
The type produced by this system param. This is expected to be the type
of
Self but with the lifetime of 'a.source§unsafe fn get<'a>(
_state: &'a mut Self::State,
_info: &'a SystemInfo,
_event_ptr: EventPtr<'a>,
world: UnsafeWorldCell<'a>
) -> Self::Item<'a>
unsafe fn get<'a>( _state: &'a mut Self::State, _info: &'a SystemInfo, _event_ptr: EventPtr<'a>, world: UnsafeWorldCell<'a> ) -> Self::Item<'a>
Obtain an instance of the system parameter. Called whenever the system
is called. Read more
source§fn refresh_archetype(_state: &mut Self::State, _arch: &Archetype)
fn refresh_archetype(_state: &mut Self::State, _arch: &Archetype)
Refresh an archetype for this system param. Called whenever
System::refresh_archetype is called.source§fn remove_archetype(_state: &mut Self::State, _arch: &Archetype)
fn remove_archetype(_state: &mut Self::State, _arch: &Archetype)
Remove the given archetype for this system param. Called whenever
System::remove_archetype is called.Auto Trait Implementations§
impl RefUnwindSafe for Components
impl Send for Components
impl Sync for Components
impl Unpin for Components
impl UnwindSafe for Components
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more