pub trait VirtualMemory {
// Required methods
fn read<T>(&self, address: u64) -> Result<T, VirtualMemoryError>
where T: BasicInt;
unsafe fn read_unchecked<T>(&self, address: u64) -> T
where T: BasicInt;
fn write<T>(
&mut self,
address: u64,
value: T,
) -> Result<(), VirtualMemoryError>
where T: BasicInt;
}Expand description
Virtual memory interface
Required Methods§
Sourcefn read<T>(&self, address: u64) -> Result<T, VirtualMemoryError>where
T: BasicInt,
fn read<T>(&self, address: u64) -> Result<T, VirtualMemoryError>where
T: BasicInt,
Read a value from memory at the specified address
Sourceunsafe fn read_unchecked<T>(&self, address: u64) -> Twhere
T: BasicInt,
unsafe fn read_unchecked<T>(&self, address: u64) -> Twhere
T: BasicInt,
Unchecked read a value from memory at the specified address.
§Safety
The address and value must be in-bounds.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.