pub struct ClientConfig {
pub api_key: String,
pub base_url: String,
pub timeout: Duration,
pub max_retries: u32,
pub log_level: LogLevel,
pub auth_method: AuthMethod,
}Fields§
§api_key: String§base_url: String§timeout: Duration§max_retries: u32§log_level: LogLevel§auth_method: AuthMethodImplementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new(api_key: impl Into<String>) -> Self
pub fn new(api_key: impl Into<String>) -> Self
Create a new client configuration with the provided API key
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set the request timeout
Sourcepub fn with_max_retries(self, max_retries: u32) -> Self
pub fn with_max_retries(self, max_retries: u32) -> Self
Set the maximum number of retries
Sourcepub fn with_log_level(self, log_level: LogLevel) -> Self
pub fn with_log_level(self, log_level: LogLevel) -> Self
Set the log level
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
Set the base URL
Sourcepub fn with_auth_method(self, auth_method: AuthMethod) -> Self
pub fn with_auth_method(self, auth_method: AuthMethod) -> Self
Set the authentication method
Sourcepub fn for_custom_gateway(self, base_url: impl Into<String>) -> Self
pub fn for_custom_gateway(self, base_url: impl Into<String>) -> Self
Configure for custom gateway (Bearer token + base URL)
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ClientConfig
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnsafeUnpin 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