pub trait EventKind:
Sealed
+ Sized
+ 'static {
const EVENT_TYPE: EventType;
// Required methods
fn into_event(self) -> Event;
fn try_from_event(event: Event) -> Result<Self, Event>;
fn try_from_event_ref(event: &Event) -> Option<&Self>;
fn try_from_event_mut(event: &mut Event) -> Option<&mut Self>;
}Expand description
Required Associated Constants§
Sourceconst EVENT_TYPE: EventType
const EVENT_TYPE: EventType
The event type.
Required Methods§
Sourcefn into_event(self) -> Event
fn into_event(self) -> Event
Wraps this value in an Event.
Sourcefn try_from_event(event: Event) -> Result<Self, Event>
fn try_from_event(event: Event) -> Result<Self, Event>
Unwraps the given event if it’s of this type, or returns it unchanged if it isn’t.
Sourcefn try_from_event_ref(event: &Event) -> Option<&Self>
fn try_from_event_ref(event: &Event) -> Option<&Self>
Returns a reference to the inner value of the given event, if it’s of this type.
Sourcefn try_from_event_mut(event: &mut Event) -> Option<&mut Self>
fn try_from_event_mut(event: &mut Event) -> Option<&mut Self>
Returns a mutable reference to the inner value of the given event, if it’s of this type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.