Trait AtomicSub

Source
pub trait AtomicSub<T = <Self as Atomic>::Primitive>: Atomic {
    // Required method
    fn fetch_sub(&self, val: T, order: Ordering) -> Self::Primitive;
}
Expand description

A trait representing atomic types that support subtraction operations.

Required Methods§

Source

fn fetch_sub(&self, val: T, order: Ordering) -> Self::Primitive

Subtracts from the current value, returning the previous value.

This operation wraps around on overflow.

fetch_sub 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.

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 AtomicSub for AtomicI8

Available on target_has_atomic="8" only.
Source§

fn fetch_sub(&self, val: i8, order: Ordering) -> i8

Source§

impl AtomicSub for AtomicI16

Available on target_has_atomic="16" only.
Source§

fn fetch_sub(&self, val: i16, order: Ordering) -> i16

Source§

impl AtomicSub for AtomicI32

Available on target_has_atomic="32" only.
Source§

fn fetch_sub(&self, val: i32, order: Ordering) -> i32

Source§

impl AtomicSub for AtomicI64

Available on target_has_atomic="64" only.
Source§

fn fetch_sub(&self, val: i64, order: Ordering) -> i64

Source§

impl AtomicSub for AtomicIsize

Available on target_has_atomic="ptr" only.
Source§

fn fetch_sub(&self, val: isize, order: Ordering) -> isize

Source§

impl AtomicSub for AtomicU8

Available on target_has_atomic="8" only.
Source§

fn fetch_sub(&self, val: u8, order: Ordering) -> u8

Source§

impl AtomicSub for AtomicU16

Available on target_has_atomic="16" only.
Source§

fn fetch_sub(&self, val: u16, order: Ordering) -> u16

Source§

impl AtomicSub for AtomicU32

Available on target_has_atomic="32" only.
Source§

fn fetch_sub(&self, val: u32, order: Ordering) -> u32

Source§

impl AtomicSub for AtomicU64

Available on target_has_atomic="64" only.
Source§

fn fetch_sub(&self, val: u64, order: Ordering) -> u64

Source§

impl AtomicSub for AtomicUsize

Available on target_has_atomic="ptr" only.
Source§

fn fetch_sub(&self, val: usize, order: Ordering) -> usize

Implementors§