pub struct WebSocket { /* private fields */ }Available on crate features
server and ws only.Expand description
WebSocketStream used In handler Request
Implementations§
Source§impl WebSocket
impl WebSocket
Sourcepub fn protocol(&self) -> Option<&str>
pub fn protocol(&self) -> Option<&str>
Get protocol of current websocket.
The value of protocol is from Sec-WebSocket-Protocol and
WebSocketUpgrade::protocols will pick one if there is any protocol that the server
gived.
Methods from Deref<Target = WebSocketStream<TokioIo<Upgraded>>>§
Sourcepub fn get_config(&self) -> &WebSocketConfig
pub fn get_config(&self) -> &WebSocketConfig
Returns a reference to the configuration of the tungstenite stream.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WebSocket
impl !RefUnwindSafe for WebSocket
impl Send for WebSocket
impl !Sync for WebSocket
impl Unpin for WebSocket
impl !UnwindSafe for WebSocket
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