pub struct Atomic(/* private fields */);atomic and target_has_atomic=64 only.Expand description
Atomic variant of Instant.
Implementations§
Source§impl Atomic
impl Atomic
Sourcepub fn fetch_max(&self, val: Instant, order: Ordering) -> Instant
pub fn fetch_max(&self, val: Instant, order: Ordering) -> Instant
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.
Note: This method is only available on platforms that support atomic operations on
[u64].
Sourcepub fn fetch_min(&self, val: Instant, order: Ordering) -> Instant
pub fn fetch_min(&self, val: Instant, order: Ordering) -> Instant
Minimum with the current value.
Finds the minimum of the current value and the argument val, and
sets the new value to the result.
Returns the previous value.
fetch_min 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.
Note: This method is only available on platforms that support atomic operations on
[u64].
Sourcepub fn into_instant(self) -> Instant
pub fn into_instant(self) -> Instant
Consumes the atomic and returns the contained Instant.
This is safe because passing self by value guarantees that no other threads are
concurrently accessing the atomic data.
Sourcepub fn swap(&self, val: Instant, order: Ordering) -> Instant
pub fn swap(&self, val: Instant, order: Ordering) -> Instant
Stores a value into the Atomic, returning the previous value.
swap 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.
Note: This method is only available on platforms that support atomic operations on
u64