pub trait ServerHandler: Send + Sync {
// Required methods
fn handle_send_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_pull_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_request<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn handle_ack<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
服务端处理器
Required Methods§
Sourcefn handle_send_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_send_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
处理发送消息
Sourcefn handle_pull_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_pull_message<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
处理拉取消息
Sourcefn handle_request<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_request<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
处理数据请求
Sourcefn handle_ack<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_ack<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
处理消息ack