Trait atomic_maybe_uninit::raw::AtomicStore
source · [−]pub trait AtomicStore: Primitive {
unsafe fn atomic_store(
dst: *mut MaybeUninit<Self>,
val: *const MaybeUninit<Self>,
order: Ordering
);
}Expand description
Atomic store.
This trait is sealed and cannot be implemented for types outside of atomic-maybe-uninit.
Required Methods
unsafe fn atomic_store(
dst: *mut MaybeUninit<Self>,
val: *const MaybeUninit<Self>,
order: Ordering
)
unsafe fn atomic_store(
dst: *mut MaybeUninit<Self>,
val: *const MaybeUninit<Self>,
order: Ordering
)
Stores a value from val 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:
- If
Selfis greater than the pointer width,dstmust be valid for both reads and writes. Otherwise,dstmust be valid for writes. dstmust be properly aligned to the size ofSelf. (For example, ifSelfisu128,dstmust be aligned to 16-byte even if the alignment ofu128is 8-byte.)dstmust go throughUnsafeCell::get.dstmust not overlap withval.valmust be valid for reads.valmust be properly aligned.ordermust beSeqCst,Release, orRelaxed.
The rules for the validity of pointer follow the rules applied to
functions exposed by the standard library’s ptr module,
except that concurrent atomic operations on dst are allowed.