pub struct WsClientBuilder { /* private fields */ }
Expand description

Builder for WsClient.

Examples


use jsonrpsee_ws_client::{WsClientBuilder, HeaderMap, HeaderValue};

#[tokio::main]
async fn main() {
    // Build custom headers used during the handshake process.
    let mut headers = HeaderMap::new();
    headers.insert("Any-Header-You-Like", HeaderValue::from_static("42"));

    // Build client
    let client = WsClientBuilder::default()
         .set_headers(headers)
         .build("wss://localhost:443")
         .await
         .unwrap();

    // use client....
}

Implementations§

See documentation WsTransportClientBuilder::certificate_store (default is native).

See documentation WsTransportClientBuilder::max_request_body_size (default is 10 MB).

See documentation ClientBuilder::request_timeout (default is 60 seconds).

See documentation WsTransportClientBuilder::connection_timeout (default is 10 seconds).

See documentation ClientBuilder::ping_interval (disabled by default).

See documentation WsTransportClientBuilder::set_headers (default is none).

See documentation ClientBuilder::max_concurrent_requests (default is 256).

See documentation ClientBuilder::max_notifs_per_subscription (default is 1024).

See documentation WsTransportClientBuilder::max_redirections (default is 5).

See documentation for ClientBuilder::id_format (default is Number).

Build the client with specified URL to connect to. You must provide the port number in the URL.

Panics

Panics if being called outside of tokio runtime context.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more