pub struct AsyncConfig {
pub timeout: Option<Duration>,
pub retries: u32,
pub backoff: BackoffStrategy,
}Expand description
Common configuration for async operations
Fields§
§timeout: Option<Duration>Timeout for operations
retries: u32Number of retries
backoff: BackoffStrategyBackoff strategy for retries
Implementations§
Source§impl AsyncConfig
impl AsyncConfig
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Create a config with a specific timeout
Sourcepub fn with_retries(self, retries: u32, backoff: BackoffStrategy) -> Self
pub fn with_retries(self, retries: u32, backoff: BackoffStrategy) -> Self
Create a config with retries
Trait Implementations§
Source§impl Clone for AsyncConfig
impl Clone for AsyncConfig
Source§fn clone(&self) -> AsyncConfig
fn clone(&self) -> AsyncConfig
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 moreSource§impl Debug for AsyncConfig
impl Debug for AsyncConfig
Auto Trait Implementations§
impl Freeze for AsyncConfig
impl RefUnwindSafe for AsyncConfig
impl Send for AsyncConfig
impl Sync for AsyncConfig
impl Unpin for AsyncConfig
impl UnsafeUnpin for AsyncConfig
impl UnwindSafe for AsyncConfig
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> Inspectable for T
impl<T> Inspectable for T
Source§fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
fn inspect_if(self, condition: bool, label: &str) -> Selfwhere
Self: Debug,
Conditionally inspect this value
Source§fn inspect_with<F>(self, label: &str, f: F) -> Self
fn inspect_with<F>(self, label: &str, f: F) -> Self
Inspect with a custom formatter