pub struct Event<C: ComponentId> {
pub kind: EventKind,
pub context: EventContext<C>,
}Expand description
An event with its context
Generic over the component ID type C which must implement ComponentId.
Fields§
§kind: EventKindThe event payload
context: EventContext<C>Context at the time of the event
Implementations§
Source§impl<C: ComponentId> Event<C>
impl<C: ComponentId> Event<C>
Sourcepub fn new(kind: EventKind, context: EventContext<C>) -> Self
pub fn new(kind: EventKind, context: EventContext<C>) -> Self
Create a new event
Sourcepub fn event_type(&self) -> EventType
pub fn event_type(&self) -> EventType
Get the event type
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Event<C>where
C: Freeze,
impl<C> RefUnwindSafe for Event<C>where
C: RefUnwindSafe,
impl<C> Send for Event<C>where
C: Send,
impl<C> Sync for Event<C>where
C: Sync,
impl<C> Unpin for Event<C>where
C: Unpin,
impl<C> UnwindSafe for Event<C>where
C: 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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