AtomicPrimitive in core::sync::atomic - Rust
Description: A marker trait for primitive types which can be modified atomically.

## AtomicPrimitive

# Trait AtomicPrimitive

Source

    pub unsafe trait AtomicPrimitive:
        Sized
        + Copy
        + Sealed {
        type AtomicInner: Sized;
    }

🔬This is a nightly-only experimental API. (`atomic_internals`)
Expand description

A marker trait for primitive types which can be modified atomically.

This is an implementation detail for `Atomic<T>` which may disappear or be replaced at any time.

## §Safety

Types implementing this trait must be primitives that can be modified atomically.

The associated `Self::AtomicInner` type must have the same size and bit validity as `Self`, but may have a higher alignment requirement, so the following `transmute`s are sound:

- `&mut Self::AtomicInner` as `&mut Self`
- `Self` as `Self::AtomicInner` or the reverse

## Required Associated Types§

Source

#### type AtomicInner: Sized

🔬This is a nightly-only experimental API. (`atomic_internals`)

Temporary implementation detail.

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

## Implementors§

Source§

### impl AtomicPrimitive for bool

Source§

#### type AtomicInner = AtomicBool

Source§

### impl AtomicPrimitive for i8

Source§

#### type AtomicInner = AtomicI8

Source§

### impl AtomicPrimitive for i16

Source§

#### type AtomicInner = AtomicI16

Source§

### impl AtomicPrimitive for i32

Source§

#### type AtomicInner = AtomicI32

Source§

### impl AtomicPrimitive for i64

Source§

#### type AtomicInner = AtomicI64

Source§

### impl AtomicPrimitive for isize

Source§

#### type AtomicInner = AtomicIsize

Source§

### impl AtomicPrimitive for u8

Source§

#### type AtomicInner = AtomicU8

Source§

### impl AtomicPrimitive for u16

Source§

#### type AtomicInner = AtomicU16

Source§

### impl AtomicPrimitive for u32

Source§

#### type AtomicInner = AtomicU32

Source§

### impl AtomicPrimitive for u64

Source§

#### type AtomicInner = AtomicU64

Source§

### impl AtomicPrimitive for usize

Source§

#### type AtomicInner = AtomicUsize

Source§

### impl<T> AtomicPrimitive for *mut T

Source§

#### type AtomicInner = AtomicPtr<T>