pub trait AtomicStore: Primitive {
// Provided method
unsafe fn atomic_store(
dst: *mut MaybeUninit<Self>,
val: MaybeUninit<Self>,
order: Ordering,
) { ... }
}Expand description
Atomic store.
This trait is sealed and cannot be implemented for types outside of atomic-maybe-uninit.
Provided Methods§
Sourceunsafe fn atomic_store(
dst: *mut MaybeUninit<Self>,
val: MaybeUninit<Self>,
order: Ordering,
)
unsafe fn atomic_store( dst: *mut MaybeUninit<Self>, val: MaybeUninit<Self>, order: Ordering, )
Stores a value into dst.
atomic_store takes an Ordering argument which describes the memory ordering of this operation.
Possible values are SeqCst, Release and Relaxed.
§Safety
Behavior is undefined if any of the following conditions are violated:
dstmust be valid for writesdstmust be aligned tosize_of::<MaybeUninit<T>>()(note that on some platforms this can be bigger thanalign_of::<MaybeUninit<T>>()).ordermust beSeqCst,Release, orRelaxed.- You must adhere to the Memory model for atomic accesses. In particular, it is not allowed to mix conflicting atomic and non-atomic accesses, or atomic accesses of different sizes, without synchronization.
Compatibility with write-only memory applies only to relaxed operations with a register or smaller width.
See the “Atomic accesses to read-only memory” section in the core::sync::atomic docs
for more.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".