Skip to main content

HttpClientWebSocketExt

Trait HttpClientWebSocketExt 

Source
pub trait HttpClientWebSocketExt<Body>:
    HttpClientWebSocketExtSealed<Body>
    + Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn websocket(
        &self,
        url: impl IntoUrl,
    ) -> WebSocketRequestBuilder<WithService<'_, Self, Body>>;
    fn websocket_h2(
        &self,
        url: impl IntoUrl,
    ) -> WebSocketRequestBuilder<WithService<'_, Self, Body>>;
    fn websocket_with_request<RequestBody: Into<Body>>(
        &self,
        req: Request<RequestBody>,
    ) -> WebSocketRequestBuilder<WithService<'_, Self, Body>>;
}
Expand description

Extends an Http Client with high level features WebSocket features.

Required Methods§

Source

fn websocket( &self, url: impl IntoUrl, ) -> WebSocketRequestBuilder<WithService<'_, Self, Body>>

Create a new WebSocketRequestBuilder] to be used to establish a WebSocket connection over http/1.1.

Source

fn websocket_h2( &self, url: impl IntoUrl, ) -> WebSocketRequestBuilder<WithService<'_, Self, Body>>

Create a new WebSocketRequestBuilder to be used to establish a WebSocket connection over h2.

Source

fn websocket_with_request<RequestBody: Into<Body>>( &self, req: Request<RequestBody>, ) -> WebSocketRequestBuilder<WithService<'_, Self, Body>>

Create a new WebSocketRequestBuilder starting from the given request.

This is useful in cases where you already have a request that you wish to use, for example in the case of a proxied reuqest.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

impl<S, Body> HttpClientWebSocketExt<Body> for S
where S: Service<Request, Output = Response<Body>, Error: Into<BoxError>>,