pub trait CoreEventContext<T> {
type OuterEvent;
// Required method
fn convert_event(event: T) -> Self::OuterEvent;
// Provided method
fn on_event<BC: EventContext<Self::OuterEvent>>(
bindings_ctx: &mut BC,
event: T,
) { ... }
}
Expand description
An event context implemented by core contexts to wrap event types that are not exposed to bindings.
Required Associated Types§
Sourcetype OuterEvent
type OuterEvent
The outer event type.
Required Methods§
Sourcefn convert_event(event: T) -> Self::OuterEvent
fn convert_event(event: T) -> Self::OuterEvent
Converts the event to the outer event type.
Provided Methods§
Sourcefn on_event<BC: EventContext<Self::OuterEvent>>(bindings_ctx: &mut BC, event: T)
fn on_event<BC: EventContext<Self::OuterEvent>>(bindings_ctx: &mut BC, event: T)
A helper to emit an event
through a bindings context that implements
EventContext
on the [OuterEvent
].
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.