Skip to main content

ClientConfigBuilder

Struct ClientConfigBuilder 

Source
pub struct ClientConfigBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> ClientConfigBuilder<S>

Source

pub fn build(self) -> ClientConfig
where S: IsComplete,

Finish building and return the requested object

Source

pub fn client_key( self, value: impl Into<String>, ) -> ClientConfigBuilder<SetClientKey<S>>
where S::ClientKey: IsUnset,

Optional (Some / Option setters). Optional key; when unset, the client reads EZCAPSOLVER_API_KEY.

Source

pub fn maybe_client_key( self, value: Option<impl Into<String>>, ) -> ClientConfigBuilder<SetClientKey<S>>
where S::ClientKey: IsUnset,

Optional (Some / Option setters). Optional key; when unset, the client reads EZCAPSOLVER_API_KEY.

Source

pub fn async_base_url( self, value: impl Into<String>, ) -> ClientConfigBuilder<SetAsyncBaseUrl<S>>
where S::AsyncBaseUrl: IsUnset,

Optional (Some / Option setters). Default: DEFAULT_ASYNC_BASE_URL.to_owned().

Base URL for asynchronous task operations and balance queries.

Override it to reach a private gateway, or to point the client at a test server. The service splits the two deployments, so they cannot share one host — see Self::sync_base_url.

Source

pub fn maybe_async_base_url( self, value: Option<impl Into<String>>, ) -> ClientConfigBuilder<SetAsyncBaseUrl<S>>
where S::AsyncBaseUrl: IsUnset,

Optional (Some / Option setters). Default: DEFAULT_ASYNC_BASE_URL.to_owned().

Base URL for asynchronous task operations and balance queries.

Override it to reach a private gateway, or to point the client at a test server. The service splits the two deployments, so they cannot share one host — see Self::sync_base_url.

Source

pub fn sync_base_url( self, value: impl Into<String>, ) -> ClientConfigBuilder<SetSyncBaseUrl<S>>
where S::SyncBaseUrl: IsUnset,

Optional (Some / Option setters). Default: DEFAULT_SYNC_BASE_URL.to_owned().

Base URL for synchronous task operations.

Source

pub fn maybe_sync_base_url( self, value: Option<impl Into<String>>, ) -> ClientConfigBuilder<SetSyncBaseUrl<S>>
where S::SyncBaseUrl: IsUnset,

Optional (Some / Option setters). Default: DEFAULT_SYNC_BASE_URL.to_owned().

Base URL for synchronous task operations.

Source

pub fn timeout(self, value: Duration) -> ClientConfigBuilder<SetTimeout<S>>
where S::Timeout: IsUnset,

Optional (Some / Option setters). Default: DEFAULT_TIMEOUT.

Timeout applied to asynchronous endpoints and balance queries.

These are millisecond-scale enqueue and lookup calls, so a short value keeps a network fault distinguishable from a slow service.

Source

pub fn maybe_timeout( self, value: Option<Duration>, ) -> ClientConfigBuilder<SetTimeout<S>>
where S::Timeout: IsUnset,

Optional (Some / Option setters). Default: DEFAULT_TIMEOUT.

Timeout applied to asynchronous endpoints and balance queries.

These are millisecond-scale enqueue and lookup calls, so a short value keeps a network fault distinguishable from a slow service.

Source

pub fn sync_timeout( self, value: Duration, ) -> ClientConfigBuilder<SetSyncTimeout<S>>
where S::SyncTimeout: IsUnset,

Optional (Some / Option setters). Default: DEFAULT_SYNC_TIMEOUT.

Timeout applied to the synchronous task endpoint.

A synchronous call blocks until the worker answers, and the service grants some task types a three-minute worker deadline. Sharing the asynchronous timeout would abort a call the service is still billing for, and a call that times out never receives the task ID it would take to recover the result.

Source

pub fn maybe_sync_timeout( self, value: Option<Duration>, ) -> ClientConfigBuilder<SetSyncTimeout<S>>
where S::SyncTimeout: IsUnset,

Optional (Some / Option setters). Default: DEFAULT_SYNC_TIMEOUT.

Timeout applied to the synchronous task endpoint.

A synchronous call blocks until the worker answers, and the service grants some task types a three-minute worker deadline. Sharing the asynchronous timeout would abort a call the service is still billing for, and a call that times out never receives the task ID it would take to recover the result.

Source

pub fn polling(self, value: PollingConfig) -> ClientConfigBuilder<SetPolling<S>>
where S::Polling: IsUnset,

Optional (Some / Option setters). Default: <PollingConfig as Default>::default().

Polling settings for asynchronous task completion.

Source

pub fn maybe_polling( self, value: Option<PollingConfig>, ) -> ClientConfigBuilder<SetPolling<S>>
where S::Polling: IsUnset,

Optional (Some / Option setters). Default: <PollingConfig as Default>::default().

Polling settings for asynchronous task completion.

Source

pub fn app_id(self, value: i32) -> ClientConfigBuilder<SetAppId<S>>
where S::AppId: IsUnset,

Optional (Some / Option setters). Optional developer application identifier.

Source

pub fn maybe_app_id( self, value: Option<i32>, ) -> ClientConfigBuilder<SetAppId<S>>
where S::AppId: IsUnset,

Optional (Some / Option setters). Optional developer application identifier.

Source

pub fn proxy(self, value: impl Into<String>) -> ClientConfigBuilder<SetProxy<S>>
where S::Proxy: IsUnset,

Optional (Some / Option setters). Optional proxy used by the SDK to reach the EzCaptchaSolver API.

Source

pub fn maybe_proxy( self, value: Option<impl Into<String>>, ) -> ClientConfigBuilder<SetProxy<S>>
where S::Proxy: IsUnset,

Optional (Some / Option setters). Optional proxy used by the SDK to reach the EzCaptchaSolver API.

Source

pub fn user_agent( self, value: impl Into<String>, ) -> ClientConfigBuilder<SetUserAgent<S>>
where S::UserAgent: IsUnset,

Optional (Some / Option setters). Default: default_user_agent().

User agent sent with every request.

Source

pub fn maybe_user_agent( self, value: Option<impl Into<String>>, ) -> ClientConfigBuilder<SetUserAgent<S>>
where S::UserAgent: IsUnset,

Optional (Some / Option setters). Default: default_user_agent().

User agent sent with every request.

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