pub struct ConnectionHandlerObserverAdapter { /* private fields */ }Expand description
ConnectionHandler 到 ConnectionObserver 的适配器
将实现了 ConnectionHandler 的 ServerMessageWrapper 适配为 ConnectionObserver
这样可以在需要 ConnectionObserver 的地方使用 ServerMessageWrapper
注意:每个连接都有自己的协商结果,parser 应该根据连接信息动态创建,而不是固定存储
Implementations§
Source§impl ConnectionHandlerObserverAdapter
impl ConnectionHandlerObserverAdapter
Sourcepub fn new(
handler: Arc<ServerMessageWrapper>,
connection_id: String,
connection_manager: Arc<ConnectionManager>,
server_core: Option<Arc<ServerCore>>,
) -> Self
pub fn new( handler: Arc<ServerMessageWrapper>, connection_id: String, connection_manager: Arc<ConnectionManager>, server_core: Option<Arc<ServerCore>>, ) -> Self
创建适配器
Trait Implementations§
Source§impl ConnectionObserver for ConnectionHandlerObserverAdapter
impl ConnectionObserver for ConnectionHandlerObserverAdapter
Source§fn on_event(&self, event: &ConnectionEvent)
fn on_event(&self, event: &ConnectionEvent)
当连接上发生事件时由
Connection 调用 Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ConnectionHandlerObserverAdapter
impl !UnwindSafe for ConnectionHandlerObserverAdapter
impl Freeze for ConnectionHandlerObserverAdapter
impl Send for ConnectionHandlerObserverAdapter
impl Sync for ConnectionHandlerObserverAdapter
impl Unpin for ConnectionHandlerObserverAdapter
impl UnsafeUnpin for ConnectionHandlerObserverAdapter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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