pub struct NoticeConnection { /* private fields */ }Expand description
通知长连接:监听刷新/公告、断开重连。
Implementations§
Source§impl NoticeConnection
impl NoticeConnection
Sourcepub async fn on_refresh<F>(&self, listener: F)
pub async fn on_refresh<F>(&self, listener: F)
监听「刷新通知数」事件。
Sourcepub async fn on_broadcast<F>(&self, listener: F)
pub async fn on_broadcast<F>(&self, listener: F)
监听全局公告事件。
Sourcepub async fn off(&self, kind: NoticeEventKind)
pub async fn off(&self, kind: NoticeEventKind)
移除某类监听。
Sourcepub fn set_retry_policy(&mut self, policy: RetryPolicy)
pub fn set_retry_policy(&mut self, policy: RetryPolicy)
设置重连策略。
Sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
断开连接。
Auto Trait Implementations§
impl !RefUnwindSafe for NoticeConnection
impl !UnwindSafe for NoticeConnection
impl Forget for NoticeConnection
impl Freeze for NoticeConnection
impl Move for NoticeConnection
impl Send for NoticeConnection
impl Sync for NoticeConnection
impl Unpin for NoticeConnection
impl UnsafeUnpin for NoticeConnection
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