Skip to main content

SpinBackoff

Struct SpinBackoff 

Source
pub struct SpinBackoff;
Expand description

Emits a spin_loop and reloads the atomic value before retrying the CAS.

Trait Implementations§

Source§

impl BackoffStrategy for SpinBackoff

Source§

fn backoff(&mut self) -> RetryStrategy

Performs backoff and returns how the CAS should be retried. Read more
Source§

fn will_reload(&self) -> bool

Returns true if the next call to backoff will not return RetryStrategy::NoReload. Read more
Source§

const BACKOFF: bool = true

Whether the strategy does backoff or not. Read more
Source§

fn backoff_reload<T: PartialEq, F: FnMut() -> T>( &mut self, current: T, reload: F, ) -> T

Performs backoff after a failed CAS and reloads the atomic value according to the returned RetryStrategy. Read more
Source§

fn backoff_until<C: BackoffUntilCondition, F: FnMut() -> C>( &mut self, f: F, ) -> C::Result

Loops until a condition is fulfilled, performing backoff at each iteration.
Source§

impl Debug for SpinBackoff

Source§

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

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

impl Default for SpinBackoff

Source§

fn default() -> SpinBackoff

Returns the “default value” for a type. 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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.