Trait rstubs::arch::io::VolatileUpdate

source ·
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§

source

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> VolatileUpdate<T> for *mut T

source§

unsafe fn update_volatile(&self, f: impl FnOnce(T) -> T)

Implementors§