#[repr(transparent)] #[derive(Debug, Clone, Copy)] pub struct Volatile(T); impl Volatile { pub unsafe fn read_volatile(self: *const Self) -> T { unsafe { core::ptr::read_volatile(self as *const T) } } pub unsafe fn write_volatile(self: *mut Self, value: T) { unsafe { core::ptr::write_volatile(self as *mut T, value) } } }