pub struct DefaultClientHandler;Expand description
默认客户端处理器
Trait Implementations§
Source§impl ClientHandler for DefaultClientHandler
impl ClientHandler for DefaultClientHandler
Source§fn on_connect<'life0, 'life1, 'async_trait>(
&'life0 self,
_connection: &'life1 Connection,
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_connect<'life0, 'life1, 'async_trait>(
&'life0 self,
_connection: &'life1 Connection,
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
连接建立时调用
Source§fn on_message<'life0, 'life1, 'async_trait>(
&'life0 self,
_connection: &'life1 Connection,
_message: Message,
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_message<'life0, 'life1, 'async_trait>(
&'life0 self,
_connection: &'life1 Connection,
_message: Message,
) -> Pin<Box<dyn Future<Output = WaeResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
收到消息时调用
Source§fn on_disconnect<'life0, 'life1, 'async_trait>(
&'life0 self,
_connection: &'life1 Connection,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn on_disconnect<'life0, 'life1, 'async_trait>(
&'life0 self,
_connection: &'life1 Connection,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
连接关闭时调用
Auto Trait Implementations§
impl Freeze for DefaultClientHandler
impl RefUnwindSafe for DefaultClientHandler
impl Send for DefaultClientHandler
impl Sync for DefaultClientHandler
impl Unpin for DefaultClientHandler
impl UnsafeUnpin for DefaultClientHandler
impl UnwindSafe for DefaultClientHandler
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