pub struct Event {
pub origin: Entity,
pub target: Entity,
pub propagation: Propagation,
pub consumable: bool,
pub unique: bool,
pub order: i32,
pub message: Box<dyn Message>,
/* private fields */
}Expand description
An event is a wrapper around a message and provides metadata on how the event should be propagated through the tree
Fields§
§origin: Entity§target: Entity§propagation: Propagation§consumable: bool§unique: bool§order: i32§message: Box<dyn Message>Implementations§
Source§impl Event
impl Event
Sourcepub fn new<M>(message: M) -> Eventwhere
M: Message,
pub fn new<M>(message: M) -> Eventwhere
M: Message,
Creates a new event with a specified message
Sourcepub fn unique(self) -> Event
pub fn unique(self) -> Event
Specifies that the event is unique (only one of this event type should exist in the event queue at once)
Sourcepub fn propagate(self, propagation: Propagation) -> Event
pub fn propagate(self, propagation: Propagation) -> Event
Sets the propagation of the event
pub fn direct(self, entity: Entity) -> Event
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Event
impl !RefUnwindSafe for Event
impl !Send for Event
impl !Sync for Event
impl Unpin for Event
impl !UnwindSafe for Event
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