pub struct VolBox<T, R, W> { /* private fields */ }
Expand description
An owned memory location for volatile reads and writes.
Implementations§
Source§impl<T, R, W> VolBox<T, R, W>
impl<T, R, W> VolBox<T, R, W>
Sourcepub const unsafe fn new(loc: *mut T) -> Self
pub const unsafe fn new(loc: *mut T) -> Self
Acquire ownership of a memory location.
If either R
or W
are Warn
, this volatile box should document
the additional safety requirements for Self::read
/Self::read_at
and Self::write
/Self::write_at
respectively.
§Safety
Behavior is undefined if any of the following conditions are violated
during the lifetime of self
:
Trait Implementations§
impl<T: Send, R, W> Send for VolBox<T, R, W>
impl<T: Sync, R, W> Sync for VolBox<T, R, W>
Auto Trait Implementations§
impl<T, R, W> Freeze for VolBox<T, R, W>
impl<T, R, W> RefUnwindSafe for VolBox<T, R, W>
impl<T, R, W> Unpin for VolBox<T, R, W>
impl<T, R, W> UnwindSafe for VolBox<T, R, W>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more