pub unsafe trait AtomicPrimitive:
Sized
+ Copy
+ Sealed {
type AtomicInner;
}
atomic_internals)
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.
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::AtomicInner as &mut Self
Self as Self::AtomicInner or the reversetype AtomicInner
atomic_internals)
Temporary implementation detail.
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
impl AtomicPrimitive for boolAvailable on target_has_atomic_load_store=8 only.
type AtomicInner = AtomicBool
impl AtomicPrimitive for i8Available on target_has_atomic_load_store=8 only.
type AtomicInner = AtomicI8
impl AtomicPrimitive for i16Available on target_has_atomic_load_store=16 only.
type AtomicInner = AtomicI16
impl AtomicPrimitive for i32Available on target_has_atomic_load_store=32 only.
type AtomicInner = AtomicI32
impl AtomicPrimitive for i64Available on target_has_atomic_load_store=64 only.
type AtomicInner = AtomicI64
impl AtomicPrimitive for isizeAvailable on target_has_atomic_load_store=ptr only.
type AtomicInner = AtomicIsize
impl AtomicPrimitive for u8Available on target_has_atomic_load_store=8 only.
type AtomicInner = AtomicU8
impl AtomicPrimitive for u16Available on target_has_atomic_load_store=16 only.
type AtomicInner = AtomicU16
impl AtomicPrimitive for u32Available on target_has_atomic_load_store=32 only.
type AtomicInner = AtomicU32
impl AtomicPrimitive for u64Available on target_has_atomic_load_store=64 only.
type AtomicInner = AtomicU64
impl AtomicPrimitive for usizeAvailable on target_has_atomic_load_store=ptr only.
type AtomicInner = AtomicUsize
impl<T> AtomicPrimitive for *mut TAvailable on target_has_atomic_load_store=ptr only.
type AtomicInner = AtomicPtr<T>
© 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/sync/atomic/trait.AtomicPrimitive.html