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§

source

type OuterEvent

The outer event type.

Required Methods§

source

fn convert_event(event: T) -> Self::OuterEvent

Converts the event to the outer event type.

Provided Methods§

source

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].

Object Safety§

This trait is not object safe.

Implementors§