pub struct Builder<T = DefaultRawClientBuilder> { /* private fields */ }
Expand description

A builder to construct Clients and blocking::Clients.

Implementations

Creates a new builder with default settings.

Applies configuration settings from a ServiceConfig to the builder.

Sets the name of the service this client will communicate with.

This is used in logging and metrics to allow differentiation between different clients.

Required.

Returns the builder’s configured service name.

Sets the user agent sent by this client.

Required.

Returns the builder’s configured user agent.

Appends a URI to the URIs list.

Defaults to an empty list.

Sets the URIs list.

Defaults to an empty list.

Returns the builder’s configured URIs list.

Sets the security configuration.

Defaults to an empty configuration.

Returns the builder’s configured security configuration.

Sets the proxy configuration.

Defaults to ProxyConfig::Direct (i.e. no proxy).

Returns the builder’s configured proxy configuration.

Sets the connect timeout.

Defaults to 10 seconds.

Returns the builder’s configured connect timeout.

Sets the read timeout.

This timeout applies to socket-level read attempts.

Defaults to 5 minutes.

Returns the builder’s configured read timeout.

Sets the write timeout.

This timeout applies to socket-level write attempts.

Defaults to 5 minutes.

Returns the builder’s configured write timeout.

Sets the backoff slot size.

This is the upper bound on the initial delay before retrying a request. It grows exponentially as additional attempts are made for a given request.

Defaults to 250 milliseconds.

Returns the builder’s configured backoff slot size.

Sets the maximum number of times a request attempt will be retried before giving up.

Defaults to 4.

Returns the builder’s configured maximum number of retries.

Sets the client’s internal rate limiting behavior.

Defaults to ClientQos::Enabled.

Returns the builder’s configured internal rate limiting behavior.

Sets the client’s behavior in response to a QoS error from the server.

Defaults to ServerQos::AutomaticRetry.

Returns the builder’s configured server QoS behavior.

Sets the client’s behavior in response to a service error from the server.

Defaults to ServiceError::WrapInNewError.

Returns the builder’s configured service error handling behavior.

Sets the client’s behavior to determine if a request is idempotent or not.

Only idempotent requests will be retried.

Defaults to Idempotency::ByMethod.

Returns the builder’s configured idempotency handling behavior.

Sets the client’s strategy for selecting a node for a request.

Defaults to NodeSelectionStrategy::PinUntilError.

Returns the builder’s configured node selection strategy.

Sets the metric registry used to register client metrics.

Defaults to no registry.

Returns the builder’s configured metric registry.

Sets the host metrics registry used to track host performance.

Defaults to no registry.

Returns the builder’s configured host metrics registry.

Sets a seed used to initialize the client’s random number generators.

Several components of the client rely on entropy. If set, the client will use the seed to initialize its internal random number generators such that clients created with the same configuration will produce the same behavior.

Defaults to no seed.

Returns the builder’s configured RNG seed.

Returns the Handle to the tokio Runtime to be used by blocking clients.

This has no effect on async clients.

Defaults to a conjure-runtime internal Runtime.

Returns the builder’s configured blocking handle.

Sets the raw client builder.

Defaults to DefaultRawClientBuilder.

Returns the builder’s configured raw client builder.

Creates a new Client.

Panics

Panics if service or user_agent is not set.

Creates a new blocking::Client.

Panics

Panics if service or user_agent is not set.

Trait Implementations

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

Calls U::from(self).

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

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