pub struct RealtimeSocket { /* private fields */ }Available on (crate features
realtime or responses-ws) and crate feature realtime only.Expand description
表示 Realtime WebSocket 连接句柄。
Implementations§
Source§impl RealtimeSocket
impl RealtimeSocket
Sourcepub fn stream(&self) -> BoxStream<'static, RealtimeStreamMessage>
pub fn stream(&self) -> BoxStream<'static, RealtimeStreamMessage>
返回一个可迭代的事件流。
Sourcepub async fn close(&self, options: SocketCloseOptions) -> Result<()>
pub async fn close(&self, options: SocketCloseOptions) -> Result<()>
主动关闭连接。
Trait Implementations§
Source§impl Clone for RealtimeSocket
impl Clone for RealtimeSocket
Source§fn clone(&self) -> RealtimeSocket
fn clone(&self) -> RealtimeSocket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RealtimeSocket
impl !RefUnwindSafe for RealtimeSocket
impl Send for RealtimeSocket
impl Sync for RealtimeSocket
impl Unpin for RealtimeSocket
impl UnsafeUnpin for RealtimeSocket
impl !UnwindSafe for RealtimeSocket
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