pub struct MappingShared { /* private fields */ }Expand description
Represents a memory range shared among multiple threads.
Note: a memory mapping is available to all vCPU running in a given VM instance, but any vCPU-owning thread with a reference to this mapping can access it.
Trait Implementations§
Source§fn clone(&self) -> MappingShared
fn clone(&self) -> MappingShared
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§fn map(&mut self, guest_addr: u64, perms: MemPerms) -> Result<()>
fn map(&mut self, guest_addr: u64, perms: MemPerms) -> Result<()>
Maps the host allocation in the guest.
Source§fn protect(&mut self, perms: MemPerms) -> Result<()>
fn protect(&mut self, perms: MemPerms) -> Result<()>
Changes the protections of memory mapping in the guest.
Source§fn read(&self, guest_addr: u64, data: &mut [u8]) -> Result<usize>
fn read(&self, guest_addr: u64, data: &mut [u8]) -> Result<usize>
Reads from a memory mapping in the guest at address
guest_addr.Source§fn write(&mut self, guest_addr: u64, data: &[u8]) -> Result<usize>
fn write(&mut self, guest_addr: u64, data: &[u8]) -> Result<usize>
Writes to a memory mapping in the guest at address
guest_addr.Source§fn get_host_addr(&self) -> *const u8
fn get_host_addr(&self) -> *const u8
Retrieves the memory mapping’s host address.
Source§fn get_guest_addr(&self) -> Option<u64>
fn get_guest_addr(&self) -> Option<u64>
Retrieves the memory mapping’s guest address.
Source§fn map_inner(
inner: &mut MappingInner,
guest_addr: u64,
perms: MemPerms,
) -> Result<()>where
Self: Sized,
fn map_inner(
inner: &mut MappingInner,
guest_addr: u64,
perms: MemPerms,
) -> Result<()>where
Self: Sized,
Underlying memory mapping function.
Source§fn unmap_inner(inner: &mut MappingInner) -> Result<()>where
Self: Sized,
fn unmap_inner(inner: &mut MappingInner) -> Result<()>where
Self: Sized,
Underlying memory unmapping function.
Source§fn protect_inner(inner: &mut MappingInner, perms: MemPerms) -> Result<()>where
Self: Sized,
fn protect_inner(inner: &mut MappingInner, perms: MemPerms) -> Result<()>where
Self: Sized,
Underlying memory protection function.
Source§fn read_inner(
inner: &MappingInner,
guest_addr: u64,
data: &mut [u8],
) -> Result<usize>where
Self: Sized,
fn read_inner(
inner: &MappingInner,
guest_addr: u64,
data: &mut [u8],
) -> Result<usize>where
Self: Sized,
Underlying memory read function.
Source§fn write_inner(
inner: &mut MappingInner,
guest_addr: u64,
data: &[u8],
) -> Result<usize>where
Self: Sized,
fn write_inner(
inner: &mut MappingInner,
guest_addr: u64,
data: &[u8],
) -> Result<usize>where
Self: Sized,
Underlying memory write function.
Source§fn write_byte(&mut self, guest_addr: u64, data: u8) -> Result<usize>
fn write_byte(&mut self, guest_addr: u64, data: u8) -> Result<usize>
Writes one byte at address
guest_addr.Source§fn write_word(&mut self, guest_addr: u64, data: u16) -> Result<usize>
fn write_word(&mut self, guest_addr: u64, data: u16) -> Result<usize>
Writes one word at address
guest_addr.Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more