pub struct ObserverClient { /* private fields */ }Expand description
观察者模式客户端实例
Implementations§
Source§impl ObserverClient
impl ObserverClient
Sourcepub async fn disconnect(&mut self) -> Result<()>
pub async fn disconnect(&mut self) -> Result<()>
断开连接
Sourcepub async fn send_frame(&mut self, frame: &Frame) -> Result<()>
pub async fn send_frame(&mut self, frame: &Frame) -> Result<()>
发送消息
Sourcepub async fn send_frame_and_wait(
&mut self,
frame: &Frame,
timeout: Duration,
) -> Result<Frame>
pub async fn send_frame_and_wait( &mut self, frame: &Frame, timeout: Duration, ) -> Result<Frame>
发送并等待响应(按 message_id 匹配)
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
检查连接状态
Sourcepub fn connection_id(&self) -> Option<String>
pub fn connection_id(&self) -> Option<String>
获取连接 ID
Sourcepub fn active_protocol(&self) -> TransportProtocol
pub fn active_protocol(&self) -> TransportProtocol
获取活动协议
Auto Trait Implementations§
impl !RefUnwindSafe for ObserverClient
impl !UnwindSafe for ObserverClient
impl Freeze for ObserverClient
impl Send for ObserverClient
impl Sync for ObserverClient
impl Unpin for ObserverClient
impl UnsafeUnpin for ObserverClient
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