pub trait Span: Deref<Target = [u8]> + Sized + Span {
// Required methods
fn len(&self) -> usize;
fn as_ptr(&self) -> *const u8;
// Provided methods
fn is_empty(&self) -> bool { ... }
fn read_volatile<T: Scalar>(&self, offset: usize) -> T { ... }
fn read_unaligned<T: Scalar>(&self, offset: usize) -> T { ... }
}
Expand description
General trait for working with any memory-safe representation of a contiguous region of arbitrary memory.
Required Methods§
Provided Methods§
sourcefn read_volatile<T: Scalar>(&self, offset: usize) -> T
fn read_volatile<T: Scalar>(&self, offset: usize) -> T
Performs a volatile read 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 read_unaligned<T: Scalar>(&self, offset: usize) -> T
fn read_unaligned<T: Scalar>(&self, offset: usize) -> T
Performs an unaligned read of the value at a given offset.
Object Safety§
This trait is not object safe.