pub trait CompareUpdate<Current, T> {
    type Error;
    type Retry;
    type Final;

    fn initial(self) -> (Self::Retry, Current, T);
    fn retry(
        retry: Self::Retry,
        current: Current,
        val: T
    ) -> Result<(Self::Retry, T), Self::Error>; fn finalize(retry: Self::Retry, val: T) -> Self::Final; }
Expand description

How to treat data across retries of AtomicCell::compare_update_raw

Required Associated Types

The error type for CompareUpdate::retrys

Backup data for retries

The final data returned

Required Methods

Create the values for the first compare_exchange_weak and some backup data for retries. U is the assumed current value

Try to create the data for the next iteration current is the value returned from the failed attempt to exchange val is the value which was failed to be stored by the previous iteration

Combine the retry data and the swapped out value into the CompareUpdate::Final data.

Implementations on Foreign Types

Implementors