pub struct HandlerInfo(/* private fields */);Expand description
Metadata for a handler.
Implementations§
Source§impl HandlerInfo
impl HandlerInfo
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Gets the name of the handler.
This name is intended for debugging purposes and should not be relied upon for correctness.
Sourcepub fn received_event(&self) -> EventId
pub fn received_event(&self) -> EventId
Gets the EventId of the event this handler listens for.
Sourcepub fn received_event_access(&self) -> Access
pub fn received_event_access(&self) -> Access
Gets the handler’s Access to the event it listens for.
Sourcepub fn targeted_event_component_access(&self) -> Option<&ComponentAccess>
pub fn targeted_event_component_access(&self) -> Option<&ComponentAccess>
Gets the expression describing the handler’s targeted event query, or
None if this handler is not targeted.
Sourcepub fn sent_global_events(
&self,
) -> impl Iterator<Item = GlobalEventIdx> + Clone + Debug + '_
pub fn sent_global_events( &self, ) -> impl Iterator<Item = GlobalEventIdx> + Clone + Debug + '_
Returns an iterator over the set of global events this handler sends.
Sourcepub fn sent_targeted_events(
&self,
) -> impl Iterator<Item = TargetedEventIdx> + Clone + Debug + '_
pub fn sent_targeted_events( &self, ) -> impl Iterator<Item = TargetedEventIdx> + Clone + Debug + '_
Returns an iterator over the set of targeted events this handler sends.
Sourcepub fn event_queue_access(&self) -> Access
pub fn event_queue_access(&self) -> Access
Gets this handler’s Access to the event queue.
Sourcepub fn component_access(&self) -> &ComponentAccess
pub fn component_access(&self) -> &ComponentAccess
Gets the expression describing this handler’s access
Sourcepub fn archetype_filter(&self) -> &ComponentAccess
pub fn archetype_filter(&self) -> &ComponentAccess
Returns the ComponentAccess used for matching archetypes.
Sourcepub fn referenced_components(
&self,
) -> impl Iterator<Item = ComponentIdx> + Clone + Debug + '_
pub fn referenced_components( &self, ) -> impl Iterator<Item = ComponentIdx> + Clone + Debug + '_
Gets the set of components referenced by this handler.
Referenced components are components used by the handler in any way. Used for cleanup when removing components.
Sourcepub fn references_component(&self, idx: ComponentIdx) -> bool
pub fn references_component(&self, idx: ComponentIdx) -> bool
Does this handler reference the given component?
Sourcepub fn priority(&self) -> HandlerPriority
pub fn priority(&self) -> HandlerPriority
Gets the HandlerPriority of this handler.
Trait Implementations§
Source§impl Debug for HandlerInfo
impl Debug for HandlerInfo
Source§impl HandlerParam for &HandlerInfo
Obtains the HandlerInfo for the running handler.
impl HandlerParam for &HandlerInfo
Obtains the HandlerInfo for the running handler.
Source§type This<'a> = &'a HandlerInfo
type This<'a> = &'a HandlerInfo
Self but with the lifetime of 'a.Source§fn init(
_world: &mut World,
_config: &mut HandlerConfig,
) -> Result<Self::State, InitError>
fn init( _world: &mut World, _config: &mut HandlerConfig, ) -> Result<Self::State, InitError>
Source§unsafe fn get<'a>(
_state: &'a mut Self::State,
info: &'a HandlerInfo,
_event_ptr: EventPtr<'a>,
_target_location: EntityLocation,
_world: UnsafeWorldCell<'a>,
) -> Self::This<'a>
unsafe fn get<'a>( _state: &'a mut Self::State, info: &'a HandlerInfo, _event_ptr: EventPtr<'a>, _target_location: EntityLocation, _world: UnsafeWorldCell<'a>, ) -> Self::This<'a>
Source§fn refresh_archetype(_state: &mut Self::State, _arch: &Archetype)
fn refresh_archetype(_state: &mut Self::State, _arch: &Archetype)
Handler::refresh_archetype is called.Source§fn remove_archetype(_state: &mut Self::State, _arch: &Archetype)
fn remove_archetype(_state: &mut Self::State, _arch: &Archetype)
Handler::remove_archetype is called.Auto Trait Implementations§
impl Freeze for HandlerInfo
impl !RefUnwindSafe for HandlerInfo
impl !Send for HandlerInfo
impl !Sync for HandlerInfo
impl Unpin for HandlerInfo
impl !UnwindSafe for HandlerInfo
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more