Trait applevisor::Mappable

source ·
pub trait Mappable {
Show 22 methods fn new(size: usize) -> Result<Self, LayoutError>
    where
        Self: Sized
; fn map(&mut self, guest_addr: u64, perms: MemPerms) -> Result<()>; fn unmap(&mut self) -> Result<()>; fn protect(&mut self, perms: MemPerms) -> Result<()>; fn read(&self, guest_addr: u64, data: &mut [u8]) -> Result<usize>; fn write(&mut self, guest_addr: u64, data: &[u8]) -> Result<usize>; fn get_host_addr(&self) -> *const u8; fn get_guest_addr(&self) -> Option<u64>; fn get_size(&self) -> usize; fn map_inner(
        inner: &mut MappingInner,
        guest_addr: u64,
        perms: MemPerms
    ) -> Result<()>
    where
        Self: Sized
, { ... } fn unmap_inner(inner: &mut MappingInner) -> Result<()>
    where
        Self: Sized
, { ... } fn protect_inner(inner: &mut MappingInner, perms: MemPerms) -> Result<()>
    where
        Self: Sized
, { ... } fn read_inner(
        inner: &MappingInner,
        guest_addr: u64,
        data: &mut [u8]
    ) -> Result<usize>
    where
        Self: Sized
, { ... } fn read_byte(&self, guest_addr: u64) -> Result<u8> { ... } fn read_word(&self, guest_addr: u64) -> Result<u16> { ... } fn read_dword(&self, guest_addr: u64) -> Result<u32> { ... } fn read_qword(&self, guest_addr: u64) -> Result<u64> { ... } fn write_inner(
        inner: &mut MappingInner,
        guest_addr: u64,
        data: &[u8]
    ) -> Result<usize>
    where
        Self: Sized
, { ... } fn write_byte(&mut self, guest_addr: u64, data: u8) -> Result<usize> { ... } fn write_word(&mut self, guest_addr: u64, data: u16) -> Result<usize> { ... } fn write_dword(&mut self, guest_addr: u64, data: u32) -> Result<usize> { ... } fn write_qword(&mut self, guest_addr: u64, data: u64) -> Result<usize> { ... }
}

Required Methods

Creates a new allocation object.

Maps the host allocation in the guest.

Maps the host allocation in the guest.

Changes the protections of memory mapping in the guest.

Reads from a memory mapping in the guest at address guest_addr.

Writes to a memory mapping in the guest at address guest_addr.

Retrieves the memory mapping’s host address.

Retrieves the memory mapping’s guest address.

Retrieves the memory mapping’s size.

Provided Methods

Underlying memory mapping function.

Underlying memory unmapping function.

Underlying memory protection function.

Underlying memory read function.

Reads one byte at address guest_addr.

Reads one word at address guest_addr.

Reads one dword at address guest_addr.

Reads one qword at address guest_addr.

Underlying memory write function.

Writes one byte at address guest_addr.

Writes one word at address guest_addr.

Writes one dword at address guest_addr.

Writes one qword at address guest_addr.

Implementors