Skip to main content

WebSocketClientExt

Trait WebSocketClientExt 

Source
pub trait WebSocketClientExt:
    Clone
    + WasmCompatSend
    + WasmCompatSync
    + 'static {
    // Required method
    fn connect(
        &self,
        request: Request<NoBody>,
        options: ConnectOptions,
    ) -> impl Future<Output = Result<BoxedWebSocketConnection>> + WasmCompatSend;
}
Available on crate feature websocket only.
Expand description

Opens websocket connections from requests with WS(S) URIs and authentication headers. Backends supply websocket handshake headers such as Sec-WebSocket-Key; callers must not supply those headers.

Required Methods§

Source

fn connect( &self, request: Request<NoBody>, options: ConnectOptions, ) -> impl Future<Output = Result<BoxedWebSocketConnection>> + WasmCompatSend

Opens a connection, preserving rejected upgrades with their HTTP status, headers, and response body.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§