pub struct ServerMessageHandler<S, A, Y>{ /* private fields */ }Expand description
组合所有命令处理器
Implementations§
Source§impl<S, A, Y> ServerMessageHandler<S, A, Y>
impl<S, A, Y> ServerMessageHandler<S, A, Y>
pub fn new( auth_handler: AuthCommandHandler<A>, server_handler: ServerCommandHandler<S>, system_handler: SystemCommandHandler<Y>, ) -> Self
Sourcepub async fn handle_new_connection(
&self,
ctx: &AppContext,
conn: &ConnectionInfo,
) -> Result<Response>
pub async fn handle_new_connection( &self, ctx: &AppContext, conn: &ConnectionInfo, ) -> Result<Response>
处理新链接
Sourcepub async fn handle_auth(&self, ctx: &AppContext) -> Result<Response>
pub async fn handle_auth(&self, ctx: &AppContext) -> Result<Response>
认证
Trait Implementations§
Source§impl<S, A, Y> CommandHandler for ServerMessageHandler<S, A, Y>where
S: ServerHandler + Send + Sync + 'static,
A: AuthHandler + Send + Sync + 'static,
Y: SystemHandler + Send + Sync + 'static,
impl<S, A, Y> CommandHandler for ServerMessageHandler<S, A, Y>where
S: ServerHandler + Send + Sync + 'static,
A: AuthHandler + Send + Sync + 'static,
Y: SystemHandler + Send + Sync + 'static,
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<S, A, Y> Default for ServerMessageHandler<S, A, Y>where
S: ServerHandler + Default + Send + Sync + 'static,
A: AuthHandler + Default + Send + Sync + 'static,
Y: SystemHandler + Default + Send + Sync + 'static,
impl<S, A, Y> Default for ServerMessageHandler<S, A, Y>where
S: ServerHandler + Default + Send + Sync + 'static,
A: AuthHandler + Default + Send + Sync + 'static,
Y: SystemHandler + Default + Send + Sync + 'static,
Auto Trait Implementations§
impl<S, A, Y> Freeze for ServerMessageHandler<S, A, Y>
impl<S, A, Y> RefUnwindSafe for ServerMessageHandler<S, A, Y>
impl<S, A, Y> Send for ServerMessageHandler<S, A, Y>
impl<S, A, Y> Sync for ServerMessageHandler<S, A, Y>
impl<S, A, Y> Unpin for ServerMessageHandler<S, A, Y>
impl<S, A, Y> UnwindSafe for ServerMessageHandler<S, A, Y>
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