pub struct ClientOptions {
pub cookies: CookieConfig,
pub request: RequestConfig,
}Expand description
Options used to create an crate::client::AmagiClient.
Fields§
Optional per-platform cookies.
request: RequestConfigShared request overrides.
Implementations§
Source§impl ClientOptions
impl ClientOptions
Sourcepub fn from_env() -> Result<Self, AppError>
pub fn from_env() -> Result<Self, AppError>
Build client options from process environment variables and layered dotenv files.
Process environment variables take precedence over dotenv values. The
default dotenv lookup order is user-level config first, then the current
working directory .env.
§Errors
Returns an error when any discovered dotenv file cannot be read or contains invalid values.
Sourcepub fn from_env_path(path: impl AsRef<Path>) -> Result<Self, AppError>
pub fn from_env_path(path: impl AsRef<Path>) -> Result<Self, AppError>
Build client options from a specific dotenv file path.
Process environment variables still take precedence over values loaded from the provided file.
§Errors
Returns an error when the file cannot be read or contains invalid values.
Trait Implementations§
Source§impl Clone for ClientOptions
impl Clone for ClientOptions
Source§fn clone(&self) -> ClientOptions
fn clone(&self) -> ClientOptions
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 ClientOptions
impl Debug for ClientOptions
Source§impl Default for ClientOptions
impl Default for ClientOptions
Source§fn default() -> ClientOptions
fn default() -> ClientOptions
Returns the “default value” for a type. Read more
Source§impl PartialEq for ClientOptions
impl PartialEq for ClientOptions
Source§impl Serialize for ClientOptions
impl Serialize for ClientOptions
impl Eq for ClientOptions
impl StructuralPartialEq for ClientOptions
Auto Trait Implementations§
impl Freeze for ClientOptions
impl RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnsafeUnpin for ClientOptions
impl UnwindSafe for ClientOptions
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