pub struct PropagateEntityTrigger<const AUTO_PROPAGATE: bool, E: EntityEvent, T: Traversal<E>> {
pub original_event_target: Entity,
pub propagate: bool,
/* private fields */
}Expand description
An EntityEvent Trigger that behaves like EntityTrigger, but “propagates” the event
using an Entity Traversal. At each step in the propagation, the EntityTrigger logic will
be run, until PropagateEntityTrigger::propagate is false, or there are no entities left to traverse.
This is used by the EntityEvent derive when #[entity_event(propagate)] is enabled. It is usable by every
EntityEvent type.
If AUTO_PROPAGATE is true, PropagateEntityTrigger::propagate will default to true.
Fields§
§original_event_target: Entity§propagate: boolWhether or not to continue propagating using the T Traversal. If this is false,
The Traversal will stop on the current entity.
Trait Implementations§
Source§impl<const AUTO_PROPAGATE: bool, E: EntityEvent, T: Traversal<E>> Debug for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>
impl<const AUTO_PROPAGATE: bool, E: EntityEvent, T: Traversal<E>> Debug for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>
Source§impl<const AUTO_PROPAGATE: bool, E: EntityEvent, T: Traversal<E>> Default for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>
impl<const AUTO_PROPAGATE: bool, E: EntityEvent, T: Traversal<E>> Default for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>
Source§impl<const AUTO_PROPAGATE: bool, E: EntityEvent + for<'a> Event<Trigger<'a> = Self>, T: Traversal<E>> Trigger<E> for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>
impl<const AUTO_PROPAGATE: bool, E: EntityEvent + for<'a> Event<Trigger<'a> = Self>, T: Traversal<E>> Trigger<E> for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>
Source§unsafe fn trigger(
&mut self,
world: DeferredWorld<'_>,
observers: &CachedObservers,
trigger_context: &TriggerContext,
event: &mut E,
)
unsafe fn trigger( &mut self, world: DeferredWorld<'_>, observers: &CachedObservers, trigger_context: &TriggerContext, event: &mut E, )
Auto Trait Implementations§
impl<const AUTO_PROPAGATE: bool, E, T> Freeze for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>
impl<const AUTO_PROPAGATE: bool, E, T> RefUnwindSafe for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>where
E: RefUnwindSafe,
T: RefUnwindSafe,
impl<const AUTO_PROPAGATE: bool, E, T> Send for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>where
T: Send,
impl<const AUTO_PROPAGATE: bool, E, T> Sync for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>where
T: Sync,
impl<const AUTO_PROPAGATE: bool, E, T> Unpin for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>
impl<const AUTO_PROPAGATE: bool, E, T> UnwindSafe for PropagateEntityTrigger<AUTO_PROPAGATE, E, T>where
E: UnwindSafe,
T: UnwindSafe,
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
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.