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 transmutes are sound:
&mut Self::AtomicInneras&mut SelfSelfasSelf::AtomicInneror the reverse
Required Associated Typesยง
Sourcetype AtomicInner: Sized
๐ฌThis is a nightly-only experimental API. (atomic_internals)
type AtomicInner: Sized
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
impl AtomicPrimitive for bool
type AtomicInner = AtomicBool
Sourceยงimpl AtomicPrimitive for i8
impl AtomicPrimitive for i8
type AtomicInner = AtomicI8
Sourceยงimpl AtomicPrimitive for i16
impl AtomicPrimitive for i16
type AtomicInner = AtomicI16
Sourceยงimpl AtomicPrimitive for i32
impl AtomicPrimitive for i32
type AtomicInner = AtomicI32
Sourceยงimpl AtomicPrimitive for i64
impl AtomicPrimitive for i64
type AtomicInner = AtomicI64
Sourceยงimpl AtomicPrimitive for i128
Available on target_has_atomic_load_store=128 only.
impl AtomicPrimitive for i128
Available on
target_has_atomic_load_store=128 only.type AtomicInner = AtomicI128
Sourceยงimpl AtomicPrimitive for isize
impl AtomicPrimitive for isize
type AtomicInner = AtomicIsize
Sourceยงimpl AtomicPrimitive for u8
impl AtomicPrimitive for u8
type AtomicInner = AtomicU8
Sourceยงimpl AtomicPrimitive for u16
impl AtomicPrimitive for u16
type AtomicInner = AtomicU16
Sourceยงimpl AtomicPrimitive for u32
impl AtomicPrimitive for u32
type AtomicInner = AtomicU32
Sourceยงimpl AtomicPrimitive for u64
impl AtomicPrimitive for u64
type AtomicInner = AtomicU64
Sourceยงimpl AtomicPrimitive for u128
Available on target_has_atomic_load_store=128 only.
impl AtomicPrimitive for u128
Available on
target_has_atomic_load_store=128 only.