pub struct ServerCommandHandler<T>(pub T);Expand description
服务端命令处理器
Tuple Fields§
§0: TImplementations§
Source§impl<T> ServerCommandHandler<T>
impl<T> ServerCommandHandler<T>
Trait Implementations§
Source§impl<T: ServerHandler + Send + Sync> CommandHandler for ServerCommandHandler<T>
impl<T: ServerHandler + Send + Sync> CommandHandler for ServerCommandHandler<T>
Source§fn handle_command<'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_command<'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,
处理命令
Source§fn supported_commands(&self) -> Vec<Command>
fn supported_commands(&self) -> Vec<Command>
获取支持的命令列表
Source§fn supports_command(&self, command: Command) -> bool
fn supports_command(&self, command: Command) -> bool
检查是否支持某个命令
Source§impl<T: ServerHandler + Send + Sync> ServerHandler for ServerCommandHandler<T>
impl<T: ServerHandler + Send + Sync> ServerHandler for ServerCommandHandler<T>
Source§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_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,
处理发送消息
Source§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_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,
处理拉取消息
Source§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_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,
处理数据请求
Source§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,
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
Auto Trait Implementations§
impl<T> Freeze for ServerCommandHandler<T>where
T: Freeze,
impl<T> RefUnwindSafe for ServerCommandHandler<T>where
T: RefUnwindSafe,
impl<T> Send for ServerCommandHandler<T>where
T: Send,
impl<T> Sync for ServerCommandHandler<T>where
T: Sync,
impl<T> Unpin for ServerCommandHandler<T>where
T: Unpin,
impl<T> UnwindSafe for ServerCommandHandler<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more