Skip to main content

VirtualMemory

Trait VirtualMemory 

Source
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§

Source

fn read<T>(&self, address: u64) -> Result<T, VirtualMemoryError>
where T: BasicInt,

Read a value from memory at the specified address

Source

unsafe fn read_unchecked<T>(&self, address: u64) -> T
where T: BasicInt,

Unchecked read a value from memory at the specified address.

§Safety

The address and value must be in-bounds.

Source

fn write<T>(&mut self, address: u64, value: T) -> Result<(), VirtualMemoryError>
where T: BasicInt,

Write a value to memory at the specified address

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.

Implementors§