pub trait IntoHandler<E: Event, Mode> { }Expand description
Type-erases a concrete handler into the internal representation expected by the bus registry.
This trait is implemented for:
- Structs implementing
EventHandler<E>(selectsAsyncMode). - Structs implementing
SyncEventHandler<E>(selectsSyncMode). async fn(E) -> HandlerResultclosures / function pointers (selectsAsyncFnMode).fn(&E) -> HandlerResultclosures / function pointers (selectsSyncFnMode).
The Mode type parameter is inferred by the compiler from the concrete
handler type; callers never need to name it explicitly.
You do not need to implement this trait manually — it is a blanket
implementation over EventHandler and SyncEventHandler.