pub struct WebsocketConnection { /* private fields */ }Expand description
A WebSocket connection resource
Implementations§
Source§impl WebsocketConnection
impl WebsocketConnection
Sourcepub fn close(
&self,
code: Option<u16>,
reason: Option<&str>,
) -> Result<(), Error>
pub fn close( &self, code: Option<u16>, reason: Option<&str>, ) -> Result<(), Error>
Send a close frame with optional code and reason. A reconstructed handle using report-connection-loss returns session-lost without reconnecting. Dropping the resource releases it locally without opening a connection.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WebsocketConnection
impl RefUnwindSafe for WebsocketConnection
impl Send for WebsocketConnection
impl Sync for WebsocketConnection
impl Unpin for WebsocketConnection
impl UnsafeUnpin for WebsocketConnection
impl UnwindSafe for WebsocketConnection
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