AtomicInteger

Trait AtomicInteger 

Source
pub trait AtomicInteger: AtomicNumber
where 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§

Source

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.

Source

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.

Source

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.

Source

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.

Implementations on Foreign Types§

Source§

impl AtomicInteger for AtomicI8

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicI16

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicI32

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicI64

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicIsize

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicU8

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicU16

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicU32

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicU64

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

impl AtomicInteger for AtomicUsize

Source§

fn fetch_and( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_nand( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_or( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Source§

fn fetch_xor( &self, value: Self::NonAtomicType, order: Ordering, ) -> Self::NonAtomicType

Implementors§