pub struct ClientConfig {
pub base_url: String,
pub timeout: Duration,
pub max_retries: u8,
pub user_agent: String,
pub rate_limit: RateLimitConfig,
pub cache: CacheConfig,
pub enable_logging: bool,
pub enable_metrics: bool,
pub connection_pool_size: usize,
pub keep_alive_timeout: Duration,
}Expand description
Configuration options for the GoldRush client.
Fields§
§base_url: StringBase URL for the GoldRush API. TODO: Confirm exact base URL with maintainers - currently using docs example
timeout: DurationRequest timeout duration.
max_retries: u8Maximum number of retry attempts for failed requests.
user_agent: StringUser agent string for requests.
rate_limit: RateLimitConfigRate limiting configuration.
cache: CacheConfigCaching configuration.
enable_logging: boolEnable request/response logging.
enable_metrics: boolEnable metrics collection.
connection_pool_size: usizeConnection pool size.
keep_alive_timeout: DurationKeep-alive timeout for connections.
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new<S: Into<String>>(base_url: S) -> Self
pub fn new<S: Into<String>>(base_url: S) -> Self
Create a new ClientConfig with custom base URL.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set the timeout for requests.
Sourcepub fn with_max_retries(self, max_retries: u8) -> Self
pub fn with_max_retries(self, max_retries: u8) -> Self
Set the maximum number of retry attempts.
Sourcepub fn with_user_agent<S: Into<String>>(self, user_agent: S) -> Self
pub fn with_user_agent<S: Into<String>>(self, user_agent: S) -> Self
Set a custom user agent.
Trait Implementations§
Source§impl Clone for ClientConfig
impl Clone for ClientConfig
Source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 ClientConfig
impl Debug for ClientConfig
Auto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnwindSafe for ClientConfig
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