Skip to main content

AtomicWithBackoffExt

Trait AtomicWithBackoffExt 

Source
pub trait AtomicWithBackoffExt: Atomic {
    // Provided methods
    fn try_update_with_backoff<S, F>(
        &self,
        set_order: Ordering,
        fetch_order: Ordering,
        f: F,
        strategy: S,
    ) -> Result<Self::Value, Self::Value>
       where S: BackoffStrategy,
             F: FnMut(Self::Value) -> Option<Self::Value> { ... }
    fn update_with_backoff<S, F>(
        &self,
        set_order: Ordering,
        fetch_order: Ordering,
        f: F,
        strategy: S,
    ) -> Self::Value
       where S: BackoffStrategy,
             F: FnMut(Self::Value) -> Self::Value { ... }
}
Expand description

Extension trait providing CAS loop methods using a given BackoffStrategy.

Provided Methods§

Source

fn try_update_with_backoff<S, F>( &self, set_order: Ordering, fetch_order: Ordering, f: F, strategy: S, ) -> Result<Self::Value, Self::Value>
where S: BackoffStrategy, F: FnMut(Self::Value) -> Option<Self::Value>,

Fetches the value, and applies a function to it that returns an optional new value.

Source

fn update_with_backoff<S, F>( &self, set_order: Ordering, fetch_order: Ordering, f: F, strategy: S, ) -> Self::Value
where S: BackoffStrategy, F: FnMut(Self::Value) -> Self::Value,

Fetches the value, applies a function to it that returns a new value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§