pub unsafe trait EventSpace<'a>: Sized + 'a {
const NAME: &'static CStr;
// Required methods
unsafe fn from_unknown(event: &'a UnknownEvent) -> Option<Self>;
fn as_unknown(&self) -> &'a UnknownEvent;
}Expand description
Required Associated Constants§
Required Methods§
Sourceunsafe fn from_unknown(event: &'a UnknownEvent) -> Option<Self>
unsafe fn from_unknown(event: &'a UnknownEvent) -> Option<Self>
Casts the given unknown event to the matching event type.
§Safety
This method does not take the event space ID into consideration. It is up to the caller to ensure that the given event does in fact belong to this event space.
Sourcefn as_unknown(&self) -> &'a UnknownEvent
fn as_unknown(&self) -> &'a UnknownEvent
Returns this event as a type-erased UnknownEvent.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".