pub trait ConnectionHandler: Send + Sync {
// Required method
fn handle_frame<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
frame: &'life1 Frame,
connection_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Frame>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
// Provided methods
fn on_connect<'life0, 'life1, 'async_trait>(
&'life0 self,
connection_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn on_disconnect<'life0, 'life1, 'async_trait>(
&'life0 self,
connection_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
连接处理器
处理单个客户端连接的逻辑
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl ConnectionHandler for ServerMessageWrapper
实现连接处理的接口