pub trait ProtocolHandler: Send + Sync {
// Required methods
fn handle_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 OdinMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<OdinMessage>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_connection_event<'life0, 'async_trait>(
&'life0 self,
event: ConnectionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Trait for protocol handlers
Required Methods§
Sourcefn handle_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 OdinMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<OdinMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 OdinMessage,
) -> Pin<Box<dyn Future<Output = Result<Option<OdinMessage>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Handle incoming message
Sourcefn handle_connection_event<'life0, 'async_trait>(
&'life0 self,
event: ConnectionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_connection_event<'life0, 'async_trait>(
&'life0 self,
event: ConnectionEvent,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle connection events