pub struct ApiClientOptions {
pub base_url: String,
pub user_agent: String,
pub timeout: Duration,
pub max_retries: usize,
pub retry_base_delay: Duration,
pub cache_ttl: Duration,
pub cache_dir: PathBuf,
pub offline: bool,
}Expand description
Configurable options for the API client.
Fields§
§base_url: StringBase URL for the Asana API.
user_agent: StringUser agent string sent with every request.
timeout: DurationTotal request timeout applied to HTTP calls.
max_retries: usizeMaximum number of retry attempts for transient failures.
retry_base_delay: DurationInitial backoff delay applied between retries.
cache_ttl: DurationTime-to-live for cached responses.
cache_dir: PathBufDirectory used to persist cached responses across runs.
offline: boolWhether the client should avoid network calls and use cached data only.
Implementations§
Source§impl ApiClientOptions
impl ApiClientOptions
Sourcepub fn with_cache_dir(self, cache_dir: PathBuf) -> Self
pub fn with_cache_dir(self, cache_dir: PathBuf) -> Self
Override the cache directory used for disk persistence.
Sourcepub const fn with_timeout(self, timeout: Duration) -> Self
pub const fn with_timeout(self, timeout: Duration) -> Self
Override the request timeout.
Sourcepub const fn with_max_retries(self, retries: usize) -> Self
pub const fn with_max_retries(self, retries: usize) -> Self
Override retry attempts.
Sourcepub const fn with_retry_base_delay(self, delay: Duration) -> Self
pub const fn with_retry_base_delay(self, delay: Duration) -> Self
Override retry backoff base delay.
Sourcepub const fn with_cache_ttl(self, ttl: Duration) -> Self
pub const fn with_cache_ttl(self, ttl: Duration) -> Self
Override cache TTL.
Sourcepub const fn with_offline(self, offline: bool) -> Self
pub const fn with_offline(self, offline: bool) -> Self
Start the client in offline mode.
Trait Implementations§
Source§impl Clone for ApiClientOptions
impl Clone for ApiClientOptions
Source§fn clone(&self) -> ApiClientOptions
fn clone(&self) -> ApiClientOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiClientOptions
impl Debug for ApiClientOptions
Auto Trait Implementations§
impl Freeze for ApiClientOptions
impl RefUnwindSafe for ApiClientOptions
impl Send for ApiClientOptions
impl Sync for ApiClientOptions
impl Unpin for ApiClientOptions
impl UnsafeUnpin for ApiClientOptions
impl UnwindSafe for ApiClientOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more