pub trait VolatileUpdate<T> {
// Required method
unsafe fn update_volatile(&self, f: impl FnOnce(T) -> T);
}
Expand description
Extension for pointers, that provides a volatile update function (read->modify->write)
Required Methods§
sourceunsafe fn update_volatile(&self, f: impl FnOnce(T) -> T)
unsafe fn update_volatile(&self, f: impl FnOnce(T) -> T)
Reads from the memory address, passes the value to f
, and writes the value it returns back to memory.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.