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
sourceimpl ClientBuilder
impl ClientBuilder
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_notifs_per_subscription(self, max: usize) -> Self
pub fn max_notifs_per_subscription(self, max: usize) -> Self
Set max concurrent notification 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.
Note: The actual capacity is num_senders + max_subscription_capacity
because it is passed to futures_channel::mpsc::channel
.
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 where
S: TransportSenderT + Send,
R: TransportReceiverT + Send,
pub fn build_with_tokio<S, R>(self, sender: S, receiver: R) -> Client where
S: TransportSenderT + Send,
R: TransportReceiverT + Send,
Trait Implementations
sourceimpl Clone for ClientBuilder
impl Clone for ClientBuilder
sourcefn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ClientBuilder
impl Debug for ClientBuilder
Auto Trait Implementations
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more