Trait atomic_maybe_uninit::raw::AtomicLoad
source · [−]pub trait AtomicLoad: Primitive {
unsafe fn atomic_load(
src: *const MaybeUninit<Self>,
out: *mut MaybeUninit<Self>,
order: Ordering
);
}Expand description
Atomic load.
This trait is sealed and cannot be implemented for types outside of atomic-maybe-uninit.
Required Methods
unsafe fn atomic_load(
src: *const MaybeUninit<Self>,
out: *mut MaybeUninit<Self>,
order: Ordering
)
unsafe fn atomic_load(
src: *const MaybeUninit<Self>,
out: *mut MaybeUninit<Self>,
order: Ordering
)
Loads a value from src into out.
atomic_load takes an Ordering argument which describes the memory ordering of this operation.
Possible values are SeqCst, Acquire and Relaxed.
Safety
Behavior is undefined if any of the following conditions are violated:
- If
Selfis greater than the pointer width,srcmust be valid for both reads and writes. Otherwise,srcmust be valid for reads. srcmust be properly aligned to the size ofSelf. (For example, ifSelfisu128,srcmust be aligned to 16-byte even if the alignment ofu128is 8-byte.)srcmust go throughUnsafeCell::get.srcmust not overlap without.outmust be valid for writes.outmust be properly aligned.ordermust beSeqCst,Acquire, 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 src are allowed.