W3cubDocs

/Rust

Function atomic_xsub

pub unsafe fn atomic_xsub<T, U, const ORD: AtomicOrdering>(
    dst: *mut T,
    src: U,
) -> Twhere
    T: Copy,
    U: Copy,
🔬This is a nightly-only experimental API. (core_intrinsics)

Subtract from the current value, returning the previous value. T must be an integer or pointer type. U must be the same as T if that is an integer type, or usize if T is a pointer type.

The stabilized version of this intrinsic is available on the atomic types via the fetch_sub method. For example, AtomicIsize::fetch_sub.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/intrinsics/fn.atomic_xsub.html