pub struct TaskConfig {
pub retry_mode: RetryMode,
}
Expand description
Task configuration for retry behavior and parameters
This struct provides configuration for task execution behavior, including retry logic and custom parameters.
Fields§
§retry_mode: RetryMode
Retry strategy for failed executions
Implementations§
Source§impl TaskConfig
impl TaskConfig
Sourcepub fn minimal() -> Self
pub fn minimal() -> Self
Create a minimal configuration with no retries
Useful for tasks that should fail fast without any retry attempts.
Sourcepub fn with_retry(self, retry_mode: RetryMode) -> Self
pub fn with_retry(self, retry_mode: RetryMode) -> Self
Set the retry mode for this configuration
Sourcepub fn with_fixed_retry(self, retries: usize, delay: Duration) -> Self
pub fn with_fixed_retry(self, retries: usize, delay: Duration) -> Self
Convenience method for fixed retry configuration
Sourcepub fn with_exponential_retry(self, max_retries: usize) -> Self
pub fn with_exponential_retry(self, max_retries: usize) -> Self
Convenience method for exponential backoff retry configuration
Trait Implementations§
Source§impl Clone for TaskConfig
impl Clone for TaskConfig
Source§fn clone(&self) -> TaskConfig
fn clone(&self) -> TaskConfig
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 Default for TaskConfig
impl Default for TaskConfig
Source§fn default() -> TaskConfig
fn default() -> TaskConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TaskConfig
impl RefUnwindSafe for TaskConfig
impl Send for TaskConfig
impl Sync for TaskConfig
impl Unpin for TaskConfig
impl UnwindSafe for TaskConfig
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