pub trait VolatileReadSlice<T, U>{
// Provided method
fn read_slice_volatile(&self, dst: &mut [U]) { ... }
}Expand description
Data which is, or can be treated as, a readable slice of volatile elements.
The data to be read is of type [U].
This trait has a blanket implementation for all types which meet the criteria.
Provided Methods§
Sourcefn read_slice_volatile(&self, dst: &mut [U])
fn read_slice_volatile(&self, dst: &mut [U])
Performs a volatile read of each element of self copying the data to
dst. This leaves the memory in self unchanged.
The length of dst must be the same as self.
§Panics
This function will panic if the two slices have different lengths.
§Safety
Just like in C, whether an operation is volatile has no bearing whatsoever on questions involving concurrent access from multiple threads. Volatile accesses behave exactly like non-atomic accesses in that regard. In particular, a race between a read operation any write operation to the same location is undefined behavior.