pub struct Connection { /* private fields */ }Expand description
WebSocket connection wrapper for browser WebSockets.
Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn close(&mut self) -> Result<()>
pub async fn close(&mut self) -> Result<()>
Close the WebSocket connection and wait for the browser close event.
Sourcepub fn negotiated_subprotocol(&self) -> Option<&str>
pub fn negotiated_subprotocol(&self) -> Option<&str>
Return the WebSocket subprotocol selected by the server, if any.
Sourcepub fn close_frame(&self) -> Option<CloseFrame>
pub fn close_frame(&self) -> Option<CloseFrame>
Return the most recently received close-frame metadata, if any.
Trait Implementations§
Source§impl Drop for Connection
impl Drop for Connection
Source§impl WebSocketConnection for Connection
impl WebSocketConnection for Connection
Auto Trait Implementations§
impl !RefUnwindSafe for Connection
impl !Send for Connection
impl !Sync for Connection
impl !UnwindSafe for Connection
impl Freeze for Connection
impl Unpin for Connection
impl UnsafeUnpin for Connection
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