pub struct ApiConfig {
pub base_url: String,
pub timeout: Duration,
pub max_retries: u32,
pub retry_delay: Duration,
pub headers: HashMap<String, String>,
pub authentication: Option<Authentication>,
pub user_agent: String,
}Expand description
API client configuration
Fields§
§base_url: String§timeout: Duration§max_retries: u32§retry_delay: Duration§headers: HashMap<String, String>§authentication: Option<Authentication>§user_agent: StringImplementations§
Source§impl ApiConfig
impl ApiConfig
pub fn new(base_url: String) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_retries(self, max_retries: u32, retry_delay: Duration) -> Self
pub fn with_authentication(self, auth: Authentication) -> Self
pub fn with_header(self, key: String, value: String) -> Self
pub fn with_user_agent(self, user_agent: String) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ApiConfig
impl<'de> Deserialize<'de> for ApiConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ApiConfig
impl RefUnwindSafe for ApiConfig
impl Send for ApiConfig
impl Sync for ApiConfig
impl Unpin for ApiConfig
impl UnwindSafe for ApiConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more