Trait utils_atomics::traits::AtomicMax
source · pub trait AtomicMax<T = <Self as Atomic>::Primitive>: Atomic {
// Required method
fn fetch_max(&self, val: T, order: Ordering) -> Self::Primitive;
}
Expand description
A trait representing atomic types that support maximum operations.
Required Methods§
sourcefn fetch_max(&self, val: T, order: Ordering) -> Self::Primitive
fn fetch_max(&self, val: T, order: Ordering) -> Self::Primitive
Maximum with the current value.
Finds the maximum of the current value and the argument val
, and
sets the new value to the result.
Returns the previous value.
fetch_max
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 AtomicMax for AtomicIsize
Available on target_has_atomic="ptr"
only.
impl AtomicMax for AtomicIsize
Available on
target_has_atomic="ptr"
only.source§impl AtomicMax for AtomicUsize
Available on target_has_atomic="ptr"
only.
impl AtomicMax for AtomicUsize
Available on
target_has_atomic="ptr"
only.