pub struct ResourceEntities(/* private fields */);Expand description
A cache that links each ComponentId from a resource to the corresponding entity.
Implementations§
Source§impl ResourceEntities
impl ResourceEntities
Sourcepub fn iter(&self) -> impl Iterator<Item = (ComponentId, Entity)>
pub fn iter(&self) -> impl Iterator<Item = (ComponentId, Entity)>
Returns an iterator over all registered resource components and their corresponding entity.
This must scan the entire array of components to find non-empty values, which may be slow even if there are few resources.
Sourcepub fn get(&self, id: ComponentId) -> Option<Entity>
pub fn get(&self, id: ComponentId) -> Option<Entity>
Returns the entity for the given resource component, or None if there is no entity.
Trait Implementations§
Source§impl Default for ResourceEntities
impl Default for ResourceEntities
Source§fn default() -> ResourceEntities
fn default() -> ResourceEntities
Returns the “default value” for a type. Read more
impl<'a> ReadOnlySystemParam for &'a ResourceEntities
Source§impl<'a> SystemParam for &'a ResourceEntities
impl<'a> SystemParam for &'a ResourceEntities
Source§type Item<'w, 's> = &'w ResourceEntities
type Item<'w, 's> = &'w ResourceEntities
The item type returned when constructing this system param.
The value of this associated type should be
Self, instantiated with new lifetimes. Read moreSource§fn init_state(_world: &mut World) -> Self::State
fn init_state(_world: &mut World) -> Self::State
Creates a new instance of this param’s
State.Source§fn init_access(
_state: &Self::State,
system_meta: &mut SystemMeta,
system_access: &mut SystemAccess,
_world: &mut World,
)
fn init_access( _state: &Self::State, system_meta: &mut SystemMeta, system_access: &mut SystemAccess, _world: &mut World, )
Source§unsafe fn get_param<'w, 's>(
_state: &'s mut Self::State,
_system_meta: &SystemMeta,
world: UnsafeWorldCell<'w>,
_change_tick: Tick,
) -> Result<Self::Item<'w, 's>, SystemParamValidationError>
unsafe fn get_param<'w, 's>( _state: &'s mut Self::State, _system_meta: &SystemMeta, world: UnsafeWorldCell<'w>, _change_tick: Tick, ) -> Result<Self::Item<'w, 's>, SystemParamValidationError>
Creates a parameter to be passed into a
SystemParamFunction. Read moreSource§fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
fn apply(state: &mut Self::State, system_meta: &SystemMeta, world: &mut World)
Applies any deferred mutations stored in this
SystemParam’s state.
This is used to apply Commands during ApplyDeferred.Source§fn queue(
state: &mut Self::State,
system_meta: &SystemMeta,
world: DeferredWorld<'_>,
)
fn queue( state: &mut Self::State, system_meta: &SystemMeta, world: DeferredWorld<'_>, )
Queues any deferred mutations to be applied at the next
ApplyDeferred.Auto Trait Implementations§
impl !Freeze for ResourceEntities
impl !RefUnwindSafe for ResourceEntities
impl Send for ResourceEntities
impl Sync for ResourceEntities
impl Unpin for ResourceEntities
impl UnsafeUnpin for ResourceEntities
impl UnwindSafe for ResourceEntities
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
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.