pub struct ClientConfig {
pub base_url: String,
pub timeout_seconds: u64,
pub client_id: String,
pub user_agent: Option<String>,
}Expand description
Client configuration
Fields§
§base_url: StringBase URL of the Cloudreve instance (e.g., “https://example.com”)
timeout_seconds: u64Timeout for requests in seconds
client_id: StringClient ID
user_agent: Option<String>User agent string for HTTP requests
Implementations§
Source§impl ClientConfig
impl ClientConfig
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Create a new configuration with the given base URL
Sourcepub fn with_timeout(self, timeout_seconds: u64) -> Self
pub fn with_timeout(self, timeout_seconds: u64) -> Self
Set the request timeout
Sourcepub fn with_client_id(self, client_id: impl Into<String>) -> Self
pub fn with_client_id(self, client_id: impl Into<String>) -> Self
Set the client ID
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Set the user agent string
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