pub struct ClientBuilder { /* private fields */ }Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn secret_key(self, secret_key: impl Into<String>) -> Self
pub fn secret_key(self, secret_key: impl Into<String>) -> Self
Sets the Alpaca API secret key.
Sourcepub fn base_url(self, base_url: impl Into<String>) -> Self
pub fn base_url(self, base_url: impl Into<String>) -> Self
Overrides the default data API base URL.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Sets the request timeout for the internally constructed reqwest::Client.
Building fails if reqwest_client(...) is also used because the injected
client owns its own timeout configuration.
Sourcepub fn reqwest_client(self, reqwest_client: Client) -> Self
pub fn reqwest_client(self, reqwest_client: Client) -> Self
Injects a preconfigured reqwest::Client for advanced transport tuning.
The injected client owns reqwest-level behavior such as connection
pooling, proxy behavior, default headers, and timeout settings. Build
validation rejects conflicting builder settings such as timeout(...).
Sourcepub fn observer(self, observer: Arc<dyn TransportObserver>) -> Self
pub fn observer(self, observer: Arc<dyn TransportObserver>) -> Self
Registers an immutable observer for successful transport responses.
Observers receive endpoint metadata only. They cannot change request execution or response shaping.
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Sets the retry budget for the shared HTTP transport.
Sourcepub fn retry_on_429(self, retry_on_429: bool) -> Self
pub fn retry_on_429(self, retry_on_429: bool) -> Self
Enables or disables automatic retries on HTTP 429 responses.
Sourcepub fn respect_retry_after(self, respect_retry_after: bool) -> Self
pub fn respect_retry_after(self, respect_retry_after: bool) -> Self
Enables or disables honoring the Retry-After response header.
Sourcepub fn base_backoff(self, base_backoff: Duration) -> Self
pub fn base_backoff(self, base_backoff: Duration) -> Self
Sets the base retry backoff used by the shared HTTP transport.
Sourcepub fn max_backoff(self, max_backoff: Duration) -> Self
pub fn max_backoff(self, max_backoff: Duration) -> Self
Sets the maximum retry backoff used by the shared HTTP transport.
Sourcepub fn retry_jitter(self, retry_jitter: Duration) -> Self
pub fn retry_jitter(self, retry_jitter: Duration) -> Self
Sets an optional jitter window applied to retry waits.
Sourcepub fn total_retry_budget(self, total_retry_budget: Duration) -> Self
pub fn total_retry_budget(self, total_retry_budget: Duration) -> Self
Sets an optional total retry time budget for a request.
Sourcepub fn credentials_from_env(self) -> Result<Self, Error>
pub fn credentials_from_env(self) -> Result<Self, Error>
Loads credentials from APCA_API_KEY_ID and APCA_API_SECRET_KEY.
If both variables are unset, the builder is left unchanged. If only one
side is set, this returns Error::InvalidConfiguration.
Sourcepub fn credentials_from_env_names(
self,
api_key_var: &str,
secret_key_var: &str,
) -> Result<Self, Error>
pub fn credentials_from_env_names( self, api_key_var: &str, secret_key_var: &str, ) -> Result<Self, Error>
Loads credentials from the provided environment variable names.
If both variables are unset, the builder is left unchanged. If only one
side is set, this returns Error::InvalidConfiguration.
Sourcepub fn max_in_flight(self, max_in_flight: usize) -> Self
pub fn max_in_flight(self, max_in_flight: usize) -> Self
Sets the maximum number of concurrent in-flight requests.
Trait Implementations§
Source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
Source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more