Trait guestmem::MappedMemoryRegion

source ·
pub trait MappedMemoryRegion: Send + Sync {
    // Required methods
    fn map(
        &self,
        offset: usize,
        section: &dyn AsMappableRef,
        file_offset: u64,
        len: usize,
        writable: bool,
    ) -> Result<()>;
    fn unmap(&self, offset: usize, len: usize) -> Result<()>;
}
Expand description

Trait implemented for a region of memory that can have memory mapped into it.

Required Methods§

source

fn map( &self, offset: usize, section: &dyn AsMappableRef, file_offset: u64, len: usize, writable: bool, ) -> Result<()>

Maps an object at offset in the region.

Behaves like mmap–overwrites and splits existing mappings.

source

fn unmap(&self, offset: usize, len: usize) -> Result<()>

Unmaps any mappings in the specified range within the region.

Implementors§