pub trait SpanMut: Span + DerefMut {
// Required method
fn as_mut_ptr(&mut self) -> *mut u8;
// Provided methods
fn write_volatile<T: Scalar>(&mut self, offset: usize, value: T) { ... }
fn write_unaligned<T: Scalar>(&mut self, offset: usize, value: T) { ... }
}
Expand description
General trait for working with any memory-safe representation of a contiguous region of arbitrary mutable memory.
Required Methods§
sourcefn as_mut_ptr(&mut self) -> *mut u8
fn as_mut_ptr(&mut self) -> *mut u8
Get a mutable pointer to the start of the allocated region.
Provided Methods§
sourcefn write_volatile<T: Scalar>(&mut self, offset: usize, value: T)
fn write_volatile<T: Scalar>(&mut self, offset: usize, value: T)
Performs a volatile write of the value at a given offset.
Volatile operations are intended to act on I/O memory, and are guaranteed to not be elided or reordered by the compiler across other volatile operations.
sourcefn write_unaligned<T: Scalar>(&mut self, offset: usize, value: T)
fn write_unaligned<T: Scalar>(&mut self, offset: usize, value: T)
Performs an unaligned write of the value at a given offset.
Object Safety§
This trait is not object safe.