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

A factory type which can create clients that will live-reload in response to configuration updates.

Implementations

Creates a new client factory based off of a refreshable ServicesConfig.

Sets the user agent sent by clients.

Required.

Returns the configured user agent.

Sets clients’ rate limiting behavior.

Defaults to ClientQos::Enabled.

Returns the configured rate limiting behavior

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

Defaults to ServerQos::AutomaticRetry.

Returns the configured QoS behavior.

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

Defaults to ServiceError::WrapInNewError.

Returns the configured service error behavior.

Sets clients’ behavior to determine if a request is idempotent or not.

Only idempotent requests will be retried.

Defaults to Idempotency::ByMethod.

Returns the configured idempotency behavior.

Sets the clients’ strategy for selecting a node for a request.

Defaults to NodeSelectionStrategy::PinUntilError.

Returns the configured node selection strategy.

Sets the metric registry used to register client metrics.

Defaults to no registry.

Returns the configured metrics registry.

Sets the host metrics registry used to track host performance.

Defaults to no registry.

Returns the configured host metrics registry.

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 configured blocking handle.

Creates a new client for the specified service.

The client’s configuration will automatically refresh to track changes in the factory’s ServicesConfig.

If no configuration is present for the specified service in the ServicesConfig, the client will immediately return an error for all requests.

The method can return any type implementing the conjure-http AsyncService trait. This notably includes all Conjure-generated client types as well as the conjure-runtime Client itself.

Panics

Panics if user_agent is not set.

Creates a new blocking client for the specified service.

The client’s configuration will automatically refresh to track changes in the factory’s ServicesConfig.

If no configuration is present for the specified service in the ServicesConfig, the client will immediately return an error for all requests.

The method can return any type implementing the conjure-http Service trait. This notably includes all Conjure-generated client types as well as the conjure-runtime blocking::Client itself.

Panics

Panics if user_agent is not set.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. 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 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