pub trait AnyConnectionObserver: Send + Sync {
// Required method
fn on_event(&self, event: &AnyClientEvent);
}Expand description
Trait for receiving events from an AnyConnection.
Implementations must be Send + Sync because the adapter installed on
the inner draft-specific connection may emit events from async tasks.
on_event takes &self — implementations that need mutation should use
interior mutability (e.g. Mutex, mpsc::Sender).
The per-draft adapter clones the draft-specific event into the matching
AnyClientEvent variant before invoking on_event.
Required Methods§
Sourcefn on_event(&self, event: &AnyClientEvent)
fn on_event(&self, event: &AnyClientEvent)
Called when a connection event occurs on any draft.