Trait MemoryRegion

Source
pub trait MemoryRegion {
    // Required method
    fn read(
        &self,
        address_range: Range<u64>,
    ) -> Result<Option<Vec<u8>>, MemoryReadError>;

    // Provided methods
    fn read_u8(&self, address: u64) -> Result<Option<u8>, MemoryReadError> { ... }
    fn read_u32(
        &self,
        address: u64,
        endianness: RunTimeEndian,
    ) -> Result<Option<u32>, MemoryReadError> { ... }
}
Expand description

A collection of bytes that capture a memory region

Required Methods§

Source

fn read( &self, address_range: Range<u64>, ) -> Result<Option<Vec<u8>>, MemoryReadError>

Returns the slice of memory that can be found at the given address_range. If the given address range is not fully within the captured region, then None is returned.

Provided Methods§

Source

fn read_u8(&self, address: u64) -> Result<Option<u8>, MemoryReadError>

Reads a byte from the given address if it is present in the region

Source

fn read_u32( &self, address: u64, endianness: RunTimeEndian, ) -> Result<Option<u32>, MemoryReadError>

Reads a u32 from the given address if it is present in the region

Implementors§