pub type BoxedWebSocketConnection = Box<dyn WebSocketConnection>;Available on crate feature
websocket only.Expand description
A type-erased WebSocketConnection.
Aliased Type§
pub struct BoxedWebSocketConnection(/* private fields */);Trait Implementations§
Source§impl WebSocketConnection for BoxedWebSocketConnection
impl WebSocketConnection for BoxedWebSocketConnection
Source§fn recv(&mut self) -> WasmBoxedFuture<'_, Result<Option<Frame>>>
fn recv(&mut self) -> WasmBoxedFuture<'_, Result<Option<Frame>>>
Read the next frame;
Ok(None) means the peer ended the stream.Source§fn close(
&mut self,
frame: Option<CloseFrame>,
) -> WasmBoxedFuture<'_, Result<()>>
fn close( &mut self, frame: Option<CloseFrame>, ) -> WasmBoxedFuture<'_, Result<()>>
Completes a close handshake. Callers must avoid repeated closes;
backends may return an error for an already closed socket.