pub trait AtomicInteger: AtomicNumberwhere
Self::NonAtomicType: Integer,{
// Required methods
fn fetch_and(
&self,
value: Self::NonAtomicType,
order: Ordering,
) -> Self::NonAtomicType;
fn fetch_nand(
&self,
value: Self::NonAtomicType,
order: Ordering,
) -> Self::NonAtomicType;
fn fetch_or(
&self,
value: Self::NonAtomicType,
order: Ordering,
) -> Self::NonAtomicType;
fn fetch_xor(
&self,
value: Self::NonAtomicType,
order: Ordering,
) -> Self::NonAtomicType;
}Expand description
An atomic integer type.
Required Methods§
Sourcefn fetch_and(
&self,
value: Self::NonAtomicType,
order: Ordering,
) -> Self::NonAtomicType
fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType
Bitwise “and” with the current value.
Performs a bitwise “and” operation on the current value and the argument val, and sets the new value to the result.
Returns the previous value.
AtomicInteger::fetch_and 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 the given type.
Sourcefn fetch_nand(
&self,
value: Self::NonAtomicType,
order: Ordering,
) -> Self::NonAtomicType
fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType
Bitwise “nand” with the current value.
Performs a bitwise “nand” operation on the current value and the argument val, and sets the new value to the result.
Returns the previous value.
AtomicInteger::fetch_nand 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 the given type.
Sourcefn fetch_or(
&self,
value: Self::NonAtomicType,
order: Ordering,
) -> Self::NonAtomicType
fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType
Bitwise “or” with the current value.
Performs a bitwise “or” operation on the current value and the argument val, and sets the new value to the result.
Returns the previous value.
AtomicInteger::fetch_or 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 the given type.
Sourcefn fetch_xor(
&self,
value: Self::NonAtomicType,
order: Ordering,
) -> Self::NonAtomicType
fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType
Bitwise “xor” with the current value.
Performs a bitwise “xor” operation on the current value and the argument val, and sets the new value to the result.
Returns the previous value.
AtomicInteger::fetch_xor 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 the given type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.