VolatileWrite

Trait VolatileWrite 

Source
pub trait VolatileWrite<T>
where Self: VolatileData<T>, T: Copy,
{ // Required method fn write(&mut self, val: T); }
Expand description

Volatile data which can be written.

The data to be written is of type T.

Required Methods§

Source

fn write(&mut self, val: T)

Performs a volatile write of self with the given value without reading the old value.

§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 write operation any other operation (reading or writing) to the same location is undefined behavior.

Implementors§

Source§

impl<T: Copy, P: Write> VolatileWrite<T> for Volatile<T, P>