Struct jsonrpsee_core::client::async_client::ClientBuilder
source · pub struct ClientBuilder { /* private fields */ }async-client and async-wasm-client and client only.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 ping_interval(self, interval: Duration) -> Self
pub fn ping_interval(self, interval: Duration) -> Self
Set the interval at which pings frames are submitted (disabled by default).
Periodically submitting pings at a defined interval has mainly two benefits:
- Directly, it acts as a “keep-alive” alternative in the WebSocket world.
- Indirectly by inspecting debug logs, it ensures that the endpoint is still responding to messages.
The underlying implementation does not make any assumptions about at which intervals pongs are received.
Note: The interval duration is restarted when
- a frontend command is submitted
- a reply is received from the backend
- the interval duration expires
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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)