Struct substrate_rpc_client::WsClientBuilder
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§
§impl WsClientBuilder
impl WsClientBuilder
pub fn certificate_store(
self,
certificate_store: CertificateStore
) -> WsClientBuilder
pub fn certificate_store( self, certificate_store: CertificateStore ) -> WsClientBuilder
See documentation [WsTransportClientBuilder::certificate_store
] (default is native).
pub fn max_request_body_size(self, size: u32) -> WsClientBuilder
pub fn max_request_body_size(self, size: u32) -> WsClientBuilder
See documentation [WsTransportClientBuilder::max_request_body_size
] (default is 10 MB).
pub fn request_timeout(self, timeout: Duration) -> WsClientBuilder
pub fn request_timeout(self, timeout: Duration) -> WsClientBuilder
See documentation [ClientBuilder::request_timeout
] (default is 60 seconds).
pub fn connection_timeout(self, timeout: Duration) -> WsClientBuilder
pub fn connection_timeout(self, timeout: Duration) -> WsClientBuilder
See documentation [WsTransportClientBuilder::connection_timeout
] (default is 10 seconds).
pub fn ping_interval(self, interval: Duration) -> WsClientBuilder
pub fn ping_interval(self, interval: Duration) -> WsClientBuilder
See documentation [ClientBuilder::ping_interval
] (disabled by default).
pub fn set_headers(self, headers: HeaderMap<HeaderValue>) -> WsClientBuilder
pub fn set_headers(self, headers: HeaderMap<HeaderValue>) -> WsClientBuilder
See documentation [WsTransportClientBuilder::set_headers
] (default is none).
pub fn max_concurrent_requests(self, max: usize) -> WsClientBuilder
pub fn max_concurrent_requests(self, max: usize) -> WsClientBuilder
See documentation [ClientBuilder::max_concurrent_requests
] (default is 256).
pub fn max_notifs_per_subscription(self, max: usize) -> WsClientBuilder
pub fn max_notifs_per_subscription(self, max: usize) -> WsClientBuilder
See documentation [ClientBuilder::max_notifs_per_subscription
] (default is 1024).
pub fn max_redirections(self, redirect: usize) -> WsClientBuilder
pub fn max_redirections(self, redirect: usize) -> WsClientBuilder
See documentation [WsTransportClientBuilder::max_redirections
] (default is 5).
pub fn id_format(self, kind: IdKind) -> WsClientBuilder
pub fn id_format(self, kind: IdKind) -> WsClientBuilder
See documentation for [ClientBuilder::id_format
] (default is Number).
Trait Implementations§
§impl Clone for WsClientBuilder
impl Clone for WsClientBuilder
§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§impl Debug for WsClientBuilder
impl Debug for WsClientBuilder
§impl Default for WsClientBuilder
impl Default for WsClientBuilder
§fn default() -> WsClientBuilder
fn default() -> WsClientBuilder
Auto Trait Implementations§
impl RefUnwindSafe for WsClientBuilder
impl Send for WsClientBuilder
impl Sync for WsClientBuilder
impl Unpin for WsClientBuilder
impl UnwindSafe for WsClientBuilder
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.