pub struct CasBuilder<T, E = BoxError> { /* private fields */ }Expand description
Builder for CasExecutor.
Implementations§
Source§impl<T, E> CasBuilder<T, E>
impl<T, E> CasBuilder<T, E>
Sourcepub fn options(self, options: RetryOptions) -> Self
pub fn options(self, options: RetryOptions) -> Self
Sourcepub fn max_attempts(self, max_attempts: u32) -> Self
pub fn max_attempts(self, max_attempts: u32) -> Self
Sourcepub fn max_retries(self, max_retries: u32) -> Self
pub fn max_retries(self, max_retries: u32) -> Self
Sourcepub fn max_operation_elapsed(
self,
max_operation_elapsed: Option<Duration>,
) -> Self
pub fn max_operation_elapsed( self, max_operation_elapsed: Option<Duration>, ) -> Self
Sourcepub fn max_total_elapsed(self, max_total_elapsed: Option<Duration>) -> Self
pub fn max_total_elapsed(self, max_total_elapsed: Option<Duration>) -> Self
Sourcepub fn delay(self, delay: RetryDelay) -> Self
pub fn delay(self, delay: RetryDelay) -> Self
Sourcepub fn fixed_delay(self, delay: Duration) -> Self
pub fn fixed_delay(self, delay: Duration) -> Self
Sourcepub fn random_delay(self, min: Duration, max: Duration) -> Self
pub fn random_delay(self, min: Duration, max: Duration) -> Self
Sourcepub fn exponential_backoff(self, initial: Duration, max: Duration) -> Self
pub fn exponential_backoff(self, initial: Duration, max: Duration) -> Self
Sourcepub fn exponential_backoff_with_multiplier(
self,
initial: Duration,
max: Duration,
multiplier: f64,
) -> Self
pub fn exponential_backoff_with_multiplier( self, initial: Duration, max: Duration, multiplier: f64, ) -> Self
Sourcepub fn jitter(self, jitter: RetryJitter) -> Self
pub fn jitter(self, jitter: RetryJitter) -> Self
Sourcepub fn jitter_factor(self, factor: f64) -> Self
pub fn jitter_factor(self, factor: f64) -> Self
Sourcepub fn attempt_timeout(self, attempt_timeout: Option<Duration>) -> Self
pub fn attempt_timeout(self, attempt_timeout: Option<Duration>) -> Self
Sourcepub fn retry_on_timeout(self) -> Self
pub fn retry_on_timeout(self) -> Self
Sourcepub fn abort_on_timeout(self) -> Self
pub fn abort_on_timeout(self) -> Self
Sourcepub fn strategy(self, strategy: CasStrategy) -> Self
pub fn strategy(self, strategy: CasStrategy) -> Self
Sourcepub fn observability(self, observability: CasObservabilityConfig) -> Self
pub fn observability(self, observability: CasObservabilityConfig) -> Self
Sourcepub fn alert_on_contention(self, thresholds: ContentionThresholds) -> Self
pub fn alert_on_contention(self, thresholds: ContentionThresholds) -> Self
Sourcepub fn isolate_listener_panics(self) -> Self
pub fn isolate_listener_panics(self) -> Self
Sourcepub fn build(self) -> Result<CasExecutor<T, E>, RetryConfigError>
pub fn build(self) -> Result<CasExecutor<T, E>, RetryConfigError>
Builds one executor after validating the settings.
§Returns
A validated CasExecutor.
§Errors
Returns RetryConfigError when the configured retry settings are
invalid.
Sourcepub fn build_contention_adaptive(
self,
) -> Result<CasExecutor<T, E>, RetryConfigError>
pub fn build_contention_adaptive( self, ) -> Result<CasExecutor<T, E>, RetryConfigError>
Builds one executor with the contention-adaptive strategy.
§Returns
A configured CasExecutor suitable for contended writers.
Sourcepub fn build_latency_first(self) -> Result<CasExecutor<T, E>, RetryConfigError>
pub fn build_latency_first(self) -> Result<CasExecutor<T, E>, RetryConfigError>
Builds one executor with the latency-first strategy.
§Returns
A configured CasExecutor optimized for low latency.
Sourcepub fn build_reliability_first(
self,
) -> Result<CasExecutor<T, E>, RetryConfigError>
pub fn build_reliability_first( self, ) -> Result<CasExecutor<T, E>, RetryConfigError>
Builds one executor with the reliability-first strategy.
§Returns
A configured CasExecutor optimized for long retry windows.
Trait Implementations§
Auto Trait Implementations§
impl<T, E> Freeze for CasBuilder<T, E>
impl<T, E> RefUnwindSafe for CasBuilder<T, E>
impl<T, E> Send for CasBuilder<T, E>
impl<T, E> Sync for CasBuilder<T, E>
impl<T, E> Unpin for CasBuilder<T, E>
impl<T, E> UnsafeUnpin for CasBuilder<T, E>
impl<T, E> UnwindSafe for CasBuilder<T, E>
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