Struct jsonrpsee_core::client::async_client::ClientBuilder
source · pub struct ClientBuilder { /* private fields */ }
Expand description
Builder for Client
.
Implementations§
source§impl ClientBuilder
impl ClientBuilder
sourcepub fn new() -> ClientBuilder
pub fn new() -> ClientBuilder
Create a builder for the client.
sourcepub fn request_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
Set request timeout (default is 60 seconds).
sourcepub fn max_concurrent_requests(self, max: usize) -> Self
pub fn max_concurrent_requests(self, max: usize) -> Self
Set max concurrent requests (default is 256).
sourcepub fn max_buffer_capacity_per_subscription(self, max: usize) -> Self
pub fn max_buffer_capacity_per_subscription(self, max: usize) -> Self
Set max buffer capacity for each subscription; when the capacity is exceeded the subscription will be dropped (default is 1024).
You may prevent the subscription from being dropped by polling often enough
Subscription::next()
such that
it can keep with the rate as server produces new items on the subscription.
§Panics
This function panics if max
is 0.
sourcepub fn id_format(self, id_kind: IdKind) -> Self
pub fn id_format(self, id_kind: IdKind) -> Self
Configure the data type of the request object ID (default is number).
sourcepub fn set_max_logging_length(self, max: u32) -> Self
pub fn set_max_logging_length(self, max: u32) -> Self
Set maximum length for logging calls and responses.
Logs bigger than this limit will be truncated.
sourcepub fn enable_ws_ping(self, cfg: PingConfig) -> Self
pub fn enable_ws_ping(self, cfg: PingConfig) -> Self
Enable WebSocket ping/pong on the client.
This only works if the transport supports WebSocket pings.
Default: pings are disabled.
sourcepub fn disable_ws_ping(self) -> Self
pub fn disable_ws_ping(self) -> Self
Disable WebSocket ping/pong on the server.
Default: pings are disabled.
sourcepub fn set_tcp_no_delay(self, no_delay: bool) -> Self
pub fn set_tcp_no_delay(self, no_delay: bool) -> Self
Configure TCP_NODELAY
on the socket to the supplied value nodelay
.
On some transports this may have no effect.
Default is true
.
sourcepub fn build_with_tokio<S, R>(self, sender: S, receiver: R) -> Client
pub fn build_with_tokio<S, R>(self, sender: S, receiver: R) -> Client
Trait Implementations§
source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ClientBuilder
impl Debug for ClientBuilder
source§impl Default for ClientBuilder
impl Default for ClientBuilder
impl Copy for ClientBuilder
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)