Skip to main content

ProtocolEvent

Trait ProtocolEvent 

Source
pub trait ProtocolEvent:
    Clone
    + Send
    + Debug
    + 'static {
    // Required methods
    fn into_transport_event(self) -> TransportEvent;
    fn session_id(&self) -> Option<SessionId>;
    fn is_data_event(&self) -> bool;
    fn is_error_event(&self) -> bool;
}
Expand description

Protocol specific event trait

This trait allows each protocol to define its own specific event types while maintaining compatibility with the unified event system

Required Methods§

Source

fn into_transport_event(self) -> TransportEvent

Convert to generic transport event

Source

fn session_id(&self) -> Option<SessionId>

Get related session ID (if any)

Source

fn is_data_event(&self) -> bool

Check if it’s a data transmission event

Source

fn is_error_event(&self) -> bool

Check if it’s an error event

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.

Implementors§