pub struct Notice { /* private fields */ }Expand description
通知客户端
Implementations§
Source§impl Notice
impl Notice
pub fn new(api_key: String) -> Self
pub async fn connect(&mut self, reload: bool) -> Result<(), WebSocketError>
Sourcepub async fn reconnect(&mut self) -> Result<(), WebSocketError>
pub async fn reconnect(&mut self) -> Result<(), WebSocketError>
重连
pub fn set_reconnect_policy(&mut self, policy: RetryPolicy)
pub fn on_ws_log<F>(&mut self, hook: F)
Sourcepub async fn off(&self, event_type: NoticeEventType)
pub async fn off(&self, event_type: NoticeEventType)
移除监听
Sourcepub fn disconnect(&mut self)
pub fn disconnect(&mut self)
断开连接
Sourcepub async fn count(&self) -> Result<NoticeCount, Error>
pub async fn count(&self) -> Result<NoticeCount, Error>
获取未读消息数
返回 NoticeCount
Sourcepub async fn list(&self, notice_type: NoticeType) -> Result<NoticeList, Error>
pub async fn list(&self, notice_type: NoticeType) -> Result<NoticeList, Error>
获取消息列表
type消息类型
返回消息列表
Auto Trait Implementations§
impl Freeze for Notice
impl !RefUnwindSafe for Notice
impl Send for Notice
impl Sync for Notice
impl Unpin for Notice
impl UnsafeUnpin for Notice
impl !UnwindSafe for Notice
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