pub struct RelaxedAtomic<T> { /* private fields */ }Expand description
Wrapper around atomic types that assumes Ordering::Relaxed for all
operations to simplify pure relaxed use cases.
Implementations§
Source§impl RelaxedAtomic<AtomicI8>
impl RelaxedAtomic<AtomicI8>
Sourcepub fn fetch_add(&self, value: i8) -> i8
pub fn fetch_add(&self, value: i8) -> i8
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: i8) -> i8
pub fn fetch_sub(&self, value: i8) -> i8
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicI16>
impl RelaxedAtomic<AtomicI16>
Sourcepub fn fetch_add(&self, value: i16) -> i16
pub fn fetch_add(&self, value: i16) -> i16
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: i16) -> i16
pub fn fetch_sub(&self, value: i16) -> i16
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicI32>
impl RelaxedAtomic<AtomicI32>
Sourcepub fn fetch_add(&self, value: i32) -> i32
pub fn fetch_add(&self, value: i32) -> i32
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: i32) -> i32
pub fn fetch_sub(&self, value: i32) -> i32
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicI64>
impl RelaxedAtomic<AtomicI64>
Sourcepub fn fetch_add(&self, value: i64) -> i64
pub fn fetch_add(&self, value: i64) -> i64
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: i64) -> i64
pub fn fetch_sub(&self, value: i64) -> i64
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicIsize>
impl RelaxedAtomic<AtomicIsize>
Sourcepub fn fetch_add(&self, value: isize) -> isize
pub fn fetch_add(&self, value: isize) -> isize
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: isize) -> isize
pub fn fetch_sub(&self, value: isize) -> isize
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicU8>
impl RelaxedAtomic<AtomicU8>
Sourcepub fn fetch_add(&self, value: u8) -> u8
pub fn fetch_add(&self, value: u8) -> u8
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: u8) -> u8
pub fn fetch_sub(&self, value: u8) -> u8
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicU16>
impl RelaxedAtomic<AtomicU16>
Sourcepub fn fetch_add(&self, value: u16) -> u16
pub fn fetch_add(&self, value: u16) -> u16
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: u16) -> u16
pub fn fetch_sub(&self, value: u16) -> u16
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicU32>
impl RelaxedAtomic<AtomicU32>
Sourcepub fn fetch_add(&self, value: u32) -> u32
pub fn fetch_add(&self, value: u32) -> u32
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: u32) -> u32
pub fn fetch_sub(&self, value: u32) -> u32
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicU64>
impl RelaxedAtomic<AtomicU64>
Sourcepub fn fetch_add(&self, value: u64) -> u64
pub fn fetch_add(&self, value: u64) -> u64
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: u64) -> u64
pub fn fetch_sub(&self, value: u64) -> u64
Subtracts from the current value, returning the previous value, with relaxed ordering.
Source§impl RelaxedAtomic<AtomicUsize>
impl RelaxedAtomic<AtomicUsize>
Sourcepub fn fetch_add(&self, value: usize) -> usize
pub fn fetch_add(&self, value: usize) -> usize
Adds to the current value, returning the previous value, with relaxed ordering.
Sourcepub fn fetch_sub(&self, value: usize) -> usize
pub fn fetch_sub(&self, value: usize) -> usize
Subtracts from the current value, returning the previous value, with relaxed ordering.
Trait Implementations§
Source§impl<T: Debug> Debug for RelaxedAtomic<T>
impl<T: Debug> Debug for RelaxedAtomic<T>
Source§impl<T: Default> Default for RelaxedAtomic<T>
impl<T: Default> Default for RelaxedAtomic<T>
Source§fn default() -> RelaxedAtomic<T>
fn default() -> RelaxedAtomic<T>
Auto Trait Implementations§
impl<T> Freeze for RelaxedAtomic<T>where
T: Freeze,
impl<T> RefUnwindSafe for RelaxedAtomic<T>where
T: RefUnwindSafe,
impl<T> Send for RelaxedAtomic<T>where
T: Send,
impl<T> Sync for RelaxedAtomic<T>where
T: Sync,
impl<T> Unpin for RelaxedAtomic<T>where
T: Unpin,
impl<T> UnsafeUnpin for RelaxedAtomic<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for RelaxedAtomic<T>where
T: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> PinInit<T> for T
impl<T> PinInit<T> for T
Source§unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), Infallible>
slot. Read moreSource§fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>where
F: FnOnce(Pin<&mut T>) -> Result<(), E>,
self then calls the function f with the initialized
value. Read more