pub struct ClientBuilder { /* private fields */ }
Expand description

Builder for Client.

Implementations§

Set request timeout (default is 60 seconds).

Set max concurrent requests (default is 256).

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.

Configure the data type of the request object ID (default is number).

Set maximum length for logging calls and responses.

Logs bigger than this limit will be truncated.

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

Build the client with given transport.

Panics

Panics if called outside of tokio runtime context.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more