DefaultRetryConfig

Struct DefaultRetryConfig 

Source
pub struct DefaultRetryConfig { /* private fields */ }
Expand description

Default retry configuration implementation

Uses Config to store all configuration values, implementing both the RetryConfig trait and the Configurable trait.

§Author

Haixing Hu

Implementations§

Source§

impl DefaultRetryConfig

Source

pub fn new() -> Self

Create a new DefaultRetryConfig instance with default configuration

Source

pub fn with_config(config: Config) -> Self

Create a new DefaultRetryConfig instance with the specified configuration

Trait Implementations§

Source§

impl Clone for DefaultRetryConfig

Source§

fn clone(&self) -> DefaultRetryConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Configurable for DefaultRetryConfig

Source§

fn config(&self) -> &Config

Gets a reference to the configuration Read more
Source§

fn config_mut(&mut self) -> &mut Config

Gets a mutable reference to the configuration Read more
Source§

fn set_config(&mut self, config: Config)

Sets the configuration Read more
Source§

fn on_config_changed(&mut self)

Callback after configuration changes Read more
Source§

impl Debug for DefaultRetryConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DefaultRetryConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl RetryConfig for DefaultRetryConfig

Source§

fn max_attempts(&self) -> u32

Get maximum number of attempts Read more
Source§

fn set_max_attempts(&mut self, max_attempts: u32) -> &mut Self

Set maximum number of attempts
Source§

fn max_duration(&self) -> Option<Duration>

Get maximum duration for retry execution Read more
Source§

fn set_max_duration(&mut self, max_duration: Option<Duration>) -> &mut Self

Set maximum duration for retry execution
Source§

fn operation_timeout(&self) -> Option<Duration>

Get single operation timeout Read more
Source§

fn set_operation_timeout(&mut self, timeout: Option<Duration>) -> &mut Self

Set single operation timeout Read more
Source§

fn delay_strategy(&self) -> RetryDelayStrategy

Get delay strategy type
Source§

fn set_delay_strategy( &mut self, delay_strategy: RetryDelayStrategy, ) -> &mut Self

Set delay strategy type
Source§

fn jitter_factor(&self) -> f64

Get jitter factor Read more
Source§

fn set_jitter_factor(&mut self, jitter_factor: f64) -> &mut Self

Set jitter factor
Source§

const KEY_MAX_ATTEMPTS: &'static str = "retry.max_attempts"

Configuration key for maximum number of attempts
Source§

const KEY_DELAY_STRATEGY: &'static str = "retry.delay_strategy"

Configuration key for delay strategy
Source§

const KEY_FIXED_DELAY: &'static str = "retry.fixed_delay_millis"

Configuration key for fixed delay time
Source§

const KEY_RANDOM_MIN_DELAY: &'static str = "retry.random_min_delay_millis"

Configuration key for random delay minimum value
Source§

const KEY_RANDOM_MAX_DELAY: &'static str = "retry.random_max_delay_millis"

Configuration key for random delay maximum value
Source§

const KEY_BACKOFF_INITIAL_DELAY: &'static str = "retry.backoff_initial_delay_millis"

Configuration key for exponential backoff initial delay
Source§

const KEY_BACKOFF_MAX_DELAY: &'static str = "retry.backoff_max_delay_millis"

Configuration key for exponential backoff maximum delay
Source§

const KEY_BACKOFF_MULTIPLIER: &'static str = "retry.backoff_multiplier"

Configuration key for exponential backoff multiplier
Source§

const KEY_JITTER_FACTOR: &'static str = "retry.jitter_factor"

Configuration key for jitter factor
Source§

const KEY_MAX_DURATION: &'static str = "retry.max_duration_millis"

Configuration key for maximum duration of retry execution
Source§

const KEY_OPERATION_TIMEOUT: &'static str = "retry.operation_timeout_millis"

Configuration key for single operation timeout
Source§

const DEFAULT_MAX_ATTEMPTS: u32 = 5u32

Default maximum number of attempts for retry mechanism
Source§

const DEFAULT_DELAY_STRATEGY: RetryDelayStrategy = _

Default delay strategy
Source§

const DEFAULT_FIXED_DELAY_MILLIS: u64 = 1_000u64

Default fixed delay time in milliseconds
Source§

const DEFAULT_RANDOM_MIN_DELAY_MILLIS: u64 = 1_000u64

Default random delay minimum value in milliseconds
Source§

const DEFAULT_RANDOM_MAX_DELAY_MILLIS: u64 = 10_000u64

Default random delay maximum value in milliseconds
Source§

const DEFAULT_BACKOFF_INITIAL_DELAY_MILLIS: u64 = 1_000u64

Default exponential backoff initial delay in milliseconds
Source§

const DEFAULT_BACKOFF_MAX_DELAY_MILLIS: u64 = 60_000u64

Default exponential backoff maximum delay in milliseconds
Source§

const DEFAULT_BACKOFF_MULTIPLIER: f64 = 2f64

Default exponential backoff multiplier
Source§

const DEFAULT_JITTER_FACTOR: f64 = 0f64

Default value for jitter factor
Source§

const DEFAULT_MAX_DURATION_MILLIS: u64 = 0u64

Default maximum duration for retry execution in milliseconds, 0 means unlimited
Source§

const DEFAULT_OPERATION_TIMEOUT_MILLIS: u64 = 0u64

Default value for single operation timeout in milliseconds, 0 means unlimited
Source§

fn set_random_delay_strategy( &mut self, min_delay: Duration, max_delay: Duration, ) -> &mut Self

Set random delay range Read more
Source§

fn set_fixed_delay_strategy(&mut self, delay: Duration) -> &mut Self

Set fixed delay Read more
Source§

fn set_exponential_backoff_strategy( &mut self, initial_delay: Duration, max_delay: Duration, multiplier: f64, ) -> &mut Self

Set exponential backoff strategy parameters Read more
Source§

fn set_no_delay_strategy(&mut self) -> &mut Self

Set no delay strategy Read more
Source§

fn set_unlimited_duration(&mut self) -> &mut Self

Set unlimited duration Read more
Source§

fn set_unlimited_operation_timeout(&mut self) -> &mut Self

Set unlimited operation timeout Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V