Trait utils_atomics::traits::AtomicSub
source · pub trait AtomicSub<T = <Self as Atomic>::Primitive>: Atomic {
// Required method
fn fetch_sub(&self, val: T, order: Ordering) -> Self::Primitive;
}
Expand description
A trait representing atomic types that support subtraction operations.
Required Methods§
sourcefn fetch_sub(&self, val: T, order: Ordering) -> Self::Primitive
fn fetch_sub(&self, val: T, order: Ordering) -> Self::Primitive
Subtracts from the current value, returning the previous value.
This operation wraps around on overflow.
fetch_sub
takes an Ordering
argument which describes the memory ordering
of this operation. All ordering modes are possible. Note that using
Acquire
makes the store part of this operation Relaxed
, and
using Release
makes the load part Relaxed
.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl AtomicSub for AtomicIsize
Available on target_has_atomic="ptr"
only.
impl AtomicSub for AtomicIsize
Available on
target_has_atomic="ptr"
only.source§impl AtomicSub for AtomicUsize
Available on target_has_atomic="ptr"
only.
impl AtomicSub for AtomicUsize
Available on
target_has_atomic="ptr"
only.