pub trait VolatileRead<T>where
Self: VolatileData<T>,
T: Copy,{
// Required method
fn read(&self) -> T;
}Expand description
Volatile data which can be read.
The data to be read is of type T.
Required Methods§
Sourcefn read(&self) -> T
fn read(&self) -> T
Performs a volatile read of the value in self without moving it. This
leaves the memory in self unchanged.
§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.