pub enum WsStream {
Tungstenite(Box<WebSocketStream<MaybeTlsStream<TcpStream>>>),
AxumWebsocket(Box<WebSocket>),
}Expand description
A enum for different type of WebSocket stream.
honestly, this is a bit of a hack, but it works. The WebSocketStream in axum is derived from tungstenite, but axum does not expose the tungstenite stream.
Variants§
Tungstenite(Box<WebSocketStream<MaybeTlsStream<TcpStream>>>)
Tungstenite WebSocket stream.
AxumWebsocket(Box<WebSocket>)
Axum WebSocket stream.
Auto Trait Implementations§
impl Freeze for WsStream
impl !RefUnwindSafe for WsStream
impl Send for WsStream
impl !Sync for WsStream
impl Unpin for WsStream
impl !UnwindSafe for WsStream
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