Function websocket027

Source
pub async fn websocket027<R: Protocol, W: Protocol>(
    request: impl IntoClientRequest + Unpin,
) -> Result<(impl Sink<W, Error = WriteError>, impl Stream<Item = Result<R, ReadError>>)>
Available on crate feature tokio-tungstenite027 only.
Expand description

Establishes a WebSocket connection to the given URL and returns a typed sink/stream pair.

Useful for WebSocket connections where the message type per direction is always the same.