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 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 more