pub struct SystemCommandHandler<T>(pub T);Expand description
系统命令处理器
Tuple Fields§
§0: TImplementations§
Source§impl<T> SystemCommandHandler<T>
impl<T> SystemCommandHandler<T>
Trait Implementations§
Source§impl<T: SystemHandler + Send + Sync> CommandHandler for SystemCommandHandler<T>
impl<T: SystemHandler + Send + Sync> CommandHandler for SystemCommandHandler<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: SystemHandler + Send + Sync> SystemHandler for SystemCommandHandler<T>
impl<T: SystemHandler + Send + Sync> SystemHandler for SystemCommandHandler<T>
Source§fn handle_new_connection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
conn: &'life2 ConnectionInfo,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle_new_connection<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
conn: &'life2 ConnectionInfo,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
处理新链接
Source§fn handle_set_background<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
background: bool,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_set_background<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
background: bool,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
设置后台运行
Source§fn handle_set_language<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
language: String,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn handle_set_language<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 AppContext,
language: String,
) -> Pin<Box<dyn Future<Output = Result<Response>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
设置语言
Source§fn handle_close<'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_close<'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,
关闭
Auto Trait Implementations§
impl<T> Freeze for SystemCommandHandler<T>where
T: Freeze,
impl<T> RefUnwindSafe for SystemCommandHandler<T>where
T: RefUnwindSafe,
impl<T> Send for SystemCommandHandler<T>where
T: Send,
impl<T> Sync for SystemCommandHandler<T>where
T: Sync,
impl<T> Unpin for SystemCommandHandler<T>where
T: Unpin,
impl<T> UnwindSafe for SystemCommandHandler<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