pub struct AmberBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> AmberBuilder<S>
impl<S: State> AmberBuilder<S>
Sourcepub fn build(self) -> Amberwhere
S: IsComplete,
pub fn build(self) -> Amberwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn client(self, value: Client) -> AmberBuilder<SetClient<S>>where
S::Client: IsUnset,
pub fn client(self, value: Client) -> AmberBuilder<SetClient<S>>where
S::Client: IsUnset,
Required.
HTTP client for making requests.
Sourcepub fn api_key(self, value: String) -> AmberBuilder<SetApiKey<S>>where
S::ApiKey: IsUnset,
pub fn api_key(self, value: String) -> AmberBuilder<SetApiKey<S>>where
S::ApiKey: IsUnset,
Sourcepub fn maybe_api_key(self, value: Option<String>) -> AmberBuilder<SetApiKey<S>>where
S::ApiKey: IsUnset,
pub fn maybe_api_key(self, value: Option<String>) -> AmberBuilder<SetApiKey<S>>where
S::ApiKey: IsUnset,
Sourcepub fn base_url(self, value: String) -> AmberBuilder<SetBaseUrl<S>>where
S::BaseUrl: IsUnset,
pub fn base_url(self, value: String) -> AmberBuilder<SetBaseUrl<S>>where
S::BaseUrl: IsUnset,
Required.
Base URL for the Amber API.
Sourcepub fn max_retries(self, value: u32) -> AmberBuilder<SetMaxRetries<S>>where
S::MaxRetries: IsUnset,
pub fn max_retries(self, value: u32) -> AmberBuilder<SetMaxRetries<S>>where
S::MaxRetries: IsUnset,
Optional (Some / Option setters).
Default: 3.
Maximum number of retry attempts for rate limit errors.
When the API returns HTTP 429 (rate limit exceeded), the client will
automatically retry up to this many times. Set to 0 to disable retries,
or use retry_on_rate_limit(false) for clearer intent.
Defaults to 3.
Sourcepub fn maybe_max_retries(
self,
value: Option<u32>,
) -> AmberBuilder<SetMaxRetries<S>>where
S::MaxRetries: IsUnset,
pub fn maybe_max_retries(
self,
value: Option<u32>,
) -> AmberBuilder<SetMaxRetries<S>>where
S::MaxRetries: IsUnset,
Optional (Some / Option setters).
Default: 3.
Maximum number of retry attempts for rate limit errors.
When the API returns HTTP 429 (rate limit exceeded), the client will
automatically retry up to this many times. Set to 0 to disable retries,
or use retry_on_rate_limit(false) for clearer intent.
Defaults to 3.
Sourcepub fn retry_on_rate_limit(
self,
value: bool,
) -> AmberBuilder<SetRetryOnRateLimit<S>>where
S::RetryOnRateLimit: IsUnset,
pub fn retry_on_rate_limit(
self,
value: bool,
) -> AmberBuilder<SetRetryOnRateLimit<S>>where
S::RetryOnRateLimit: IsUnset,
Optional (Some / Option setters).
Default: true.
Whether to automatically retry on rate limit errors.
When enabled (default), the client automatically waits and retries when
hitting rate limits. The wait time is read from the RateLimit-Reset
header, or defaults to 60 seconds if not present.
When disabled, rate limit errors are returned immediately as
[AmberError::RateLimitExceeded].
Default to true.
Sourcepub fn maybe_retry_on_rate_limit(
self,
value: Option<bool>,
) -> AmberBuilder<SetRetryOnRateLimit<S>>where
S::RetryOnRateLimit: IsUnset,
pub fn maybe_retry_on_rate_limit(
self,
value: Option<bool>,
) -> AmberBuilder<SetRetryOnRateLimit<S>>where
S::RetryOnRateLimit: IsUnset,
Optional (Some / Option setters).
Default: true.
Whether to automatically retry on rate limit errors.
When enabled (default), the client automatically waits and retries when
hitting rate limits. The wait time is read from the RateLimit-Reset
header, or defaults to 60 seconds if not present.
When disabled, rate limit errors are returned immediately as
[AmberError::RateLimitExceeded].
Default to true.