pub struct CasExecutor<T, E = BoxError> { /* private fields */ }Expand description
Executor for retry-aware compare-and-swap workflows.
Implementations§
Source§impl<T, E> CasExecutor<T, E>
impl<T, E> CasExecutor<T, E>
Sourcepub fn builder() -> CasBuilder<T, E>
pub fn builder() -> CasBuilder<T, E>
Sourcepub fn from_options(options: RetryOptions) -> Result<Self, RetryConfigError>
pub fn from_options(options: RetryOptions) -> Result<Self, RetryConfigError>
Sourcepub fn latency_first() -> Self
pub fn latency_first() -> Self
Creates an executor tuned for low-latency workloads.
§Returns
A configured executor. The built-in strategy is always valid.
Sourcepub fn contention_adaptive() -> Self
pub fn contention_adaptive() -> Self
Creates an executor tuned for hot-contention workloads.
§Returns
A configured executor. The built-in strategy is always valid.
Sourcepub fn reliability_first() -> Self
pub fn reliability_first() -> Self
Creates an executor tuned for reliability-first workloads.
§Returns
A configured executor. The built-in strategy is always valid.
Sourcepub fn with_strategy(strategy: CasStrategy) -> Self
pub fn with_strategy(strategy: CasStrategy) -> Self
Sourcepub fn options(&self) -> &RetryOptions
pub fn options(&self) -> &RetryOptions
Sourcepub fn attempt_timeout(&self) -> Option<Duration>
pub fn attempt_timeout(&self) -> Option<Duration>
Returns the configured async attempt timeout.
§Returns
Some(Duration) when async attempts have a timeout.
Sourcepub fn timeout_policy(&self) -> CasTimeoutPolicy
pub fn timeout_policy(&self) -> CasTimeoutPolicy
Sourcepub fn observability(&self) -> &CasObservabilityConfig
pub fn observability(&self) -> &CasObservabilityConfig
Sourcepub fn execute<R, O>(
&self,
state: &AtomicRef<T>,
operation: O,
) -> CasOutcome<T, R, E>where
T: 'static,
E: 'static,
O: Function<T, CasDecision<T, R, E>>,
pub fn execute<R, O>(
&self,
state: &AtomicRef<T>,
operation: O,
) -> CasOutcome<T, R, E>where
T: 'static,
E: 'static,
O: Function<T, CasDecision<T, R, E>>,
Sourcepub fn execute_with_hooks<R, O>(
&self,
state: &AtomicRef<T>,
operation: O,
hooks: CasHooks,
) -> CasOutcome<T, R, E>where
T: 'static,
E: 'static,
O: Function<T, CasDecision<T, R, E>>,
pub fn execute_with_hooks<R, O>(
&self,
state: &AtomicRef<T>,
operation: O,
hooks: CasHooks,
) -> CasOutcome<T, R, E>where
T: 'static,
E: 'static,
O: Function<T, CasDecision<T, R, E>>,
Executes one synchronous CAS operation with lifecycle hooks.
§Parameters
state: Shared atomic state container.operation: Pure operation that inspects the current state and returns a CAS decision.hooks: Per-execution hook registrations.
§Returns
A terminal result together with the execution report.
Sourcepub async fn execute_async<R, O, Fut>(
&self,
state: &AtomicRef<T>,
operation: O,
) -> CasOutcome<T, R, E>
pub async fn execute_async<R, O, Fut>( &self, state: &AtomicRef<T>, operation: O, ) -> CasOutcome<T, R, E>
Sourcepub async fn execute_async_with_hooks<R, O, Fut>(
&self,
state: &AtomicRef<T>,
operation: O,
hooks: CasHooks,
) -> CasOutcome<T, R, E>
pub async fn execute_async_with_hooks<R, O, Fut>( &self, state: &AtomicRef<T>, operation: O, hooks: CasHooks, ) -> CasOutcome<T, R, E>
Trait Implementations§
Source§impl<T: Clone, E: Clone> Clone for CasExecutor<T, E>
impl<T: Clone, E: Clone> Clone for CasExecutor<T, E>
Source§fn clone(&self) -> CasExecutor<T, E>
fn clone(&self) -> CasExecutor<T, E>
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 moreAuto Trait Implementations§
impl<T, E> Freeze for CasExecutor<T, E>
impl<T, E> RefUnwindSafe for CasExecutor<T, E>
impl<T, E> Send for CasExecutor<T, E>
impl<T, E> Sync for CasExecutor<T, E>
impl<T, E> Unpin for CasExecutor<T, E>
impl<T, E> UnsafeUnpin for CasExecutor<T, E>
impl<T, E> UnwindSafe for CasExecutor<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