Skip to main content

ClientBuilder

Struct ClientBuilder 

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

Builder for Client.

Implementations§

Source§

impl ClientBuilder

Source

pub fn endpoints(self, endpoints: Endpoints) -> Self

Uses custom provider endpoints.

Source

pub fn timeout(self, timeout: Duration) -> Self

Sets the per-request timeout.

Source

pub fn response_limit(self, bytes: usize) -> Self

Sets the maximum decoded HTTP response size.

Source

pub fn realtime_event_capacity(self, capacity: usize) -> Self

Sets queued real-time events per hub (default 65,536).

This is a stalled-consumer signal, not a subscription quota. Saturation retains a nonterminal gap; the socket and invocation completions continue. Increase it for larger bursts or a slower consumer. Build rejects zero or values outside Tokio’s representable permit range; there is no SDK ceiling.

Source

pub fn realtime_writer_capacity(self, capacity: usize) -> Self

Sets queued outbound real-time messages per hub (default 4,096). A full queue refuses new admission with SendQueueFull without sending. Build rejects zero or values outside Tokio’s representable permit range.

Source

pub fn realtime_pending_invocation_capacity(self, capacity: usize) -> Self

Sets simultaneous incomplete real-time invocations per hub (default 4,096). Completed subscriptions consume no slots and have no total-count limit. A full set refuses admission with PendingInvocationCapacity before sending. Build rejects zero or values outside Tokio’s representable permit range.

Source

pub fn realtime_invocation_timeout(self, timeout: Duration) -> Self

Sets the real-time invocation completion wait after enqueue (default 15s). A deadline includes writer-queue time, preserves an unknown outcome and never closes the socket or resends the request. Build rejects zero or durations outside Tokio’s representable clock range.

Source

pub fn proxy(self, proxy: impl Into<String>) -> Self

Routes HTTP requests through the supplied proxy URL.

Ambient process proxy variables are deliberately ignored. This method is the only way to enable proxying for REST and real-time traffic.

Source

pub fn max_retries(self, max_retries: u32) -> Self

Sets the number of retries for read/query requests.

Money-moving mutations are never retried.

Source

pub fn retry_delays(self, initial: Duration, maximum: Duration) -> Self

Sets the initial and maximum exponential retry delays.

Source

pub fn rate_limits(self, rate_limits: RateLimitConfig) -> Self

Replaces the default ProjectX REST rate limits.

The configured budgets are shared by the built Client and all of its clones.

Source

pub fn disable_rate_limits(self) -> Self

Disables local REST rate limiting.

Use this only when an external coordinator enforces the provider limits across every client and process using the same credentials. Provider HTTP 429 responses still participate in query retry delays.

Source

pub fn build(self) -> Result<Client, Error>

Builds the client without performing network I/O.

§Errors

Returns an error for zero timeout/response limits, an invalid or unsafe proxy combination, or a transport configuration failure.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more