Struct jsonrpsee_ws_client::WsClientBuilder
source · 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§
source§impl WsClientBuilder
impl WsClientBuilder
sourcepub fn certificate_store(self, certificate_store: CertificateStore) -> Self
pub fn certificate_store(self, certificate_store: CertificateStore) -> Self
See documentation WsTransportClientBuilder::certificate_store
(default is native).
sourcepub fn max_request_body_size(self, size: u32) -> Self
pub fn max_request_body_size(self, size: u32) -> Self
See documentation WsTransportClientBuilder::max_request_body_size
(default is 10 MB).
sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
See documentation ClientBuilder::request_timeout
(default is 60 seconds).
sourcepub fn connection_timeout(self, timeout: Duration) -> Self
pub fn connection_timeout(self, timeout: Duration) -> Self
See documentation WsTransportClientBuilder::connection_timeout
(default is 10 seconds).
sourcepub fn ping_interval(self, interval: Duration) -> Self
pub fn ping_interval(self, interval: Duration) -> Self
See documentation ClientBuilder::ping_interval
(disabled by default).
sourcepub fn set_headers(self, headers: HeaderMap) -> Self
pub fn set_headers(self, headers: HeaderMap) -> Self
See documentation WsTransportClientBuilder::set_headers
(default is none).
sourcepub fn max_concurrent_requests(self, max: usize) -> Self
pub fn max_concurrent_requests(self, max: usize) -> Self
See documentation ClientBuilder::max_concurrent_requests
(default is 256).
sourcepub fn max_notifs_per_subscription(self, max: usize) -> Self
pub fn max_notifs_per_subscription(self, max: usize) -> Self
See documentation ClientBuilder::max_notifs_per_subscription
(default is 1024).
sourcepub fn max_redirections(self, redirect: usize) -> Self
pub fn max_redirections(self, redirect: usize) -> Self
See documentation WsTransportClientBuilder::max_redirections
(default is 5).
sourcepub fn id_format(self, kind: IdKind) -> Self
pub fn id_format(self, kind: IdKind) -> Self
See documentation for ClientBuilder::id_format
(default is Number).
Trait Implementations§
source§impl Clone for WsClientBuilder
impl Clone for WsClientBuilder
source§fn clone(&self) -> WsClientBuilder
fn clone(&self) -> WsClientBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more