Skip to main content

AtomicBits

Trait AtomicBits 

Source
pub trait AtomicBits: Copy {
    type Storage;

    // Required methods
    fn new(bits: Self) -> Self::Storage;
    fn store(storage: &Self::Storage, bits: Self, ordering: Ordering);
    fn load(storage: &Self::Storage, ordering: Ordering) -> Self;
    fn fetch_and(
        storage: &Self::Storage,
        bits: Self,
        ordering: Ordering,
    ) -> Self;
    fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self;
    fn fetch_xor(
        storage: &Self::Storage,
        bits: Self,
        ordering: Ordering,
    ) -> Self;
    fn fetch_nand(
        storage: &Self::Storage,
        bits: Self,
        ordering: Ordering,
    ) -> Self;
    fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self;
    fn compare_exchange(
        storage: &Self::Storage,
        current: Self,
        new: Self,
        success: Ordering,
        failure: Ordering,
    ) -> Result<Self, Self>;
    fn compare_exchange_weak(
        storage: &Self::Storage,
        current: Self,
        new: Self,
        success: Ordering,
        failure: Ordering,
    ) -> Result<Self, Self>;
    fn into_inner(storage: Self::Storage) -> Self;
}
Expand description

Integer type that can back an AtomicFlags.

Implemented for every integer type bitflags supports except u128 and i128, which have no atomic counterpart.

Required Associated Types§

Source

type Storage

The atomic type that holds the bits.

Required Methods§

Source

fn new(bits: Self) -> Self::Storage

Source

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source

fn into_inner(storage: Self::Storage) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AtomicBits for i8

Source§

type Storage = Atomic<i8>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for i16

Source§

type Storage = Atomic<i16>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for i32

Source§

type Storage = Atomic<i32>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for i64

Source§

type Storage = Atomic<i64>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for isize

Source§

type Storage = Atomic<isize>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for u8

Source§

type Storage = Atomic<u8>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for u16

Source§

type Storage = Atomic<u16>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for u32

Source§

type Storage = Atomic<u32>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for u64

Source§

type Storage = Atomic<u64>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Source§

impl AtomicBits for usize

Source§

type Storage = Atomic<usize>

Source§

fn new(bits: Self) -> Self::Storage

Source§

fn store(storage: &Self::Storage, bits: Self, ordering: Ordering)

Source§

fn load(storage: &Self::Storage, ordering: Ordering) -> Self

Source§

fn fetch_and(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_or(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_xor(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn fetch_nand(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn swap(storage: &Self::Storage, bits: Self, ordering: Ordering) -> Self

Source§

fn compare_exchange( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn compare_exchange_weak( storage: &Self::Storage, current: Self, new: Self, success: Ordering, failure: Ordering, ) -> Result<Self, Self>

Source§

fn into_inner(storage: Self::Storage) -> Self

Implementors§