pub struct RelaxedAtomic<T>(/* private fields */);Expand description
A wrapper around an atomic primitive providing relaxed memory ordering operations.
Implementations§
Source§impl RelaxedAtomic<AtomicBool>
impl RelaxedAtomic<AtomicBool>
Sourcepub fn compare_exchange(&self, current: bool, new: bool) -> Result<bool, bool>
pub fn compare_exchange(&self, current: bool, new: bool) -> Result<bool, bool>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(
&self,
current: bool,
new: bool,
) -> Result<bool, bool>
pub fn compare_exchange_weak( &self, current: bool, new: bool, ) -> Result<bool, bool>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicI8>
impl RelaxedAtomic<AtomicI8>
Sourcepub fn compare_exchange(&self, current: i8, new: i8) -> Result<i8, i8>
pub fn compare_exchange(&self, current: i8, new: i8) -> Result<i8, i8>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(&self, current: i8, new: i8) -> Result<i8, i8>
pub fn compare_exchange_weak(&self, current: i8, new: i8) -> Result<i8, i8>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicI8>
impl RelaxedAtomic<AtomicI8>
Sourcepub fn fetch_nand(&self, val: i8) -> i8
pub fn fetch_nand(&self, val: i8) -> i8
Bitwise NANDs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicI16>
impl RelaxedAtomic<AtomicI16>
Sourcepub fn compare_exchange(&self, current: i16, new: i16) -> Result<i16, i16>
pub fn compare_exchange(&self, current: i16, new: i16) -> Result<i16, i16>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(&self, current: i16, new: i16) -> Result<i16, i16>
pub fn compare_exchange_weak(&self, current: i16, new: i16) -> Result<i16, i16>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicI16>
impl RelaxedAtomic<AtomicI16>
Sourcepub fn fetch_sub(&self, val: i16) -> i16
pub fn fetch_sub(&self, val: i16) -> i16
Subtracts from the value with relaxed memory ordering.
Sourcepub fn fetch_nand(&self, val: i16) -> i16
pub fn fetch_nand(&self, val: i16) -> i16
Bitwise NANDs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicI32>
impl RelaxedAtomic<AtomicI32>
Sourcepub fn compare_exchange(&self, current: i32, new: i32) -> Result<i32, i32>
pub fn compare_exchange(&self, current: i32, new: i32) -> Result<i32, i32>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(&self, current: i32, new: i32) -> Result<i32, i32>
pub fn compare_exchange_weak(&self, current: i32, new: i32) -> Result<i32, i32>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicI32>
impl RelaxedAtomic<AtomicI32>
Sourcepub fn fetch_sub(&self, val: i32) -> i32
pub fn fetch_sub(&self, val: i32) -> i32
Subtracts from the value with relaxed memory ordering.
Sourcepub fn fetch_nand(&self, val: i32) -> i32
pub fn fetch_nand(&self, val: i32) -> i32
Bitwise NANDs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicI64>
impl RelaxedAtomic<AtomicI64>
Sourcepub fn compare_exchange(&self, current: i64, new: i64) -> Result<i64, i64>
pub fn compare_exchange(&self, current: i64, new: i64) -> Result<i64, i64>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(&self, current: i64, new: i64) -> Result<i64, i64>
pub fn compare_exchange_weak(&self, current: i64, new: i64) -> Result<i64, i64>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicI64>
impl RelaxedAtomic<AtomicI64>
Sourcepub fn fetch_sub(&self, val: i64) -> i64
pub fn fetch_sub(&self, val: i64) -> i64
Subtracts from the value with relaxed memory ordering.
Sourcepub fn fetch_nand(&self, val: i64) -> i64
pub fn fetch_nand(&self, val: i64) -> i64
Bitwise NANDs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicIsize>
impl RelaxedAtomic<AtomicIsize>
Sourcepub fn compare_exchange(
&self,
current: isize,
new: isize,
) -> Result<isize, isize>
pub fn compare_exchange( &self, current: isize, new: isize, ) -> Result<isize, isize>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(
&self,
current: isize,
new: isize,
) -> Result<isize, isize>
pub fn compare_exchange_weak( &self, current: isize, new: isize, ) -> Result<isize, isize>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicIsize>
impl RelaxedAtomic<AtomicIsize>
Sourcepub fn fetch_sub(&self, val: isize) -> isize
pub fn fetch_sub(&self, val: isize) -> isize
Subtracts from the value with relaxed memory ordering.
Sourcepub fn fetch_and(&self, val: isize) -> isize
pub fn fetch_and(&self, val: isize) -> isize
Bitwise ANDs the value with relaxed memory ordering.
Sourcepub fn fetch_nand(&self, val: isize) -> isize
pub fn fetch_nand(&self, val: isize) -> isize
Bitwise NANDs the value with relaxed memory ordering.
Sourcepub fn fetch_or(&self, val: isize) -> isize
pub fn fetch_or(&self, val: isize) -> isize
Bitwise ORs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicU8>
impl RelaxedAtomic<AtomicU8>
Sourcepub fn compare_exchange(&self, current: u8, new: u8) -> Result<u8, u8>
pub fn compare_exchange(&self, current: u8, new: u8) -> Result<u8, u8>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(&self, current: u8, new: u8) -> Result<u8, u8>
pub fn compare_exchange_weak(&self, current: u8, new: u8) -> Result<u8, u8>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicU8>
impl RelaxedAtomic<AtomicU8>
Sourcepub fn fetch_nand(&self, val: u8) -> u8
pub fn fetch_nand(&self, val: u8) -> u8
Bitwise NANDs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicU16>
impl RelaxedAtomic<AtomicU16>
Sourcepub fn compare_exchange(&self, current: u16, new: u16) -> Result<u16, u16>
pub fn compare_exchange(&self, current: u16, new: u16) -> Result<u16, u16>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(&self, current: u16, new: u16) -> Result<u16, u16>
pub fn compare_exchange_weak(&self, current: u16, new: u16) -> Result<u16, u16>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicU16>
impl RelaxedAtomic<AtomicU16>
Sourcepub fn fetch_sub(&self, val: u16) -> u16
pub fn fetch_sub(&self, val: u16) -> u16
Subtracts from the value with relaxed memory ordering.
Sourcepub fn fetch_nand(&self, val: u16) -> u16
pub fn fetch_nand(&self, val: u16) -> u16
Bitwise NANDs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicU32>
impl RelaxedAtomic<AtomicU32>
Sourcepub fn compare_exchange(&self, current: u32, new: u32) -> Result<u32, u32>
pub fn compare_exchange(&self, current: u32, new: u32) -> Result<u32, u32>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(&self, current: u32, new: u32) -> Result<u32, u32>
pub fn compare_exchange_weak(&self, current: u32, new: u32) -> Result<u32, u32>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicU32>
impl RelaxedAtomic<AtomicU32>
Sourcepub fn fetch_sub(&self, val: u32) -> u32
pub fn fetch_sub(&self, val: u32) -> u32
Subtracts from the value with relaxed memory ordering.
Sourcepub fn fetch_nand(&self, val: u32) -> u32
pub fn fetch_nand(&self, val: u32) -> u32
Bitwise NANDs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicU64>
impl RelaxedAtomic<AtomicU64>
Sourcepub fn compare_exchange(&self, current: u64, new: u64) -> Result<u64, u64>
pub fn compare_exchange(&self, current: u64, new: u64) -> Result<u64, u64>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(&self, current: u64, new: u64) -> Result<u64, u64>
pub fn compare_exchange_weak(&self, current: u64, new: u64) -> Result<u64, u64>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicU64>
impl RelaxedAtomic<AtomicU64>
Sourcepub fn fetch_sub(&self, val: u64) -> u64
pub fn fetch_sub(&self, val: u64) -> u64
Subtracts from the value with relaxed memory ordering.
Sourcepub fn fetch_nand(&self, val: u64) -> u64
pub fn fetch_nand(&self, val: u64) -> u64
Bitwise NANDs the value with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicUsize>
impl RelaxedAtomic<AtomicUsize>
Sourcepub fn compare_exchange(
&self,
current: usize,
new: usize,
) -> Result<usize, usize>
pub fn compare_exchange( &self, current: usize, new: usize, ) -> Result<usize, usize>
Performs compare-and-exchange with relaxed memory ordering.
Sourcepub fn compare_exchange_weak(
&self,
current: usize,
new: usize,
) -> Result<usize, usize>
pub fn compare_exchange_weak( &self, current: usize, new: usize, ) -> Result<usize, usize>
Performs weak compare-and-exchange with relaxed memory ordering.
Source§impl RelaxedAtomic<AtomicUsize>
impl RelaxedAtomic<AtomicUsize>
Sourcepub fn fetch_sub(&self, val: usize) -> usize
pub fn fetch_sub(&self, val: usize) -> usize
Subtracts from the value with relaxed memory ordering.
Sourcepub fn fetch_and(&self, val: usize) -> usize
pub fn fetch_and(&self, val: usize) -> usize
Bitwise ANDs the value with relaxed memory ordering.
Sourcepub fn fetch_nand(&self, val: usize) -> usize
pub fn fetch_nand(&self, val: usize) -> usize
Bitwise NANDs the value with relaxed memory ordering.
Sourcepub fn fetch_or(&self, val: usize) -> usize
pub fn fetch_or(&self, val: usize) -> usize
Bitwise ORs the value with relaxed memory ordering.