Nand

Trait Nand 

Source
pub trait Nand {
    type Type;

    // Required method
    fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type;
}
Expand description

Bitwise “nand” with the current value.

Required Associated Types§

Source

type Type

The underlying type

Required Methods§

Source

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

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.

§Examples
use std::sync::atomic::{AtomicU8, Ordering};
use atomic_traits::{Atomic, fetch};

let foo = AtomicU8::new(0x13);
assert_eq!(fetch::Nand::fetch_nand(&foo, 0x31, Ordering::SeqCst), 0x13);
assert_eq!(Atomic::load(&foo, Ordering::SeqCst), !(0x13 & 0x31));

Implementations on Foreign Types§

Source§

impl Nand for AtomicBool

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = bool

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicI8

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = i8

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicI16

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = i16

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicI32

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = i32

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicI64

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = i64

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicIsize

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = isize

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicU8

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = u8

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicU16

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = u16

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicU32

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = u32

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicU64

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = u64

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Source§

impl Nand for AtomicUsize

Available on crate features atomic_nand or since_1_27_0 only.
Source§

type Type = usize

Source§

fn fetch_nand(&self, val: Self::Type, order: Ordering) -> Self::Type

Implementors§