pub struct MemoryRegion {
pub guest_addr: GuestAddress,
pub size: u64,
pub host_addr: Option<*mut u8>,
pub read_only: bool,
}Expand description
A contiguous region of guest memory.
Fields§
§guest_addr: GuestAddressGuest physical address of the region start.
size: u64Size of the region in bytes.
host_addr: Option<*mut u8>Host virtual address (if mapped).
read_only: boolWhether the region is read-only.
Implementations§
Source§impl MemoryRegion
impl MemoryRegion
Sourcepub const fn new(guest_addr: GuestAddress, size: u64) -> Self
pub const fn new(guest_addr: GuestAddress, size: u64) -> Self
Creates a new memory region.
Sourcepub const fn end(&self) -> GuestAddress
pub const fn end(&self) -> GuestAddress
Returns the end address of the region (exclusive).
Sourcepub const fn contains(&self, addr: GuestAddress) -> bool
pub const fn contains(&self, addr: GuestAddress) -> bool
Checks if the region contains the given address.
Sourcepub const fn contains_range(&self, addr: GuestAddress, size: u64) -> bool
pub const fn contains_range(&self, addr: GuestAddress, size: u64) -> bool
Checks if the region contains the given range.
Trait Implementations§
Source§impl Clone for MemoryRegion
impl Clone for MemoryRegion
Source§fn clone(&self) -> MemoryRegion
fn clone(&self) -> MemoryRegion
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§impl Debug for MemoryRegion
impl Debug for MemoryRegion
impl Send for MemoryRegion
impl Sync for MemoryRegion
Auto Trait Implementations§
impl Freeze for MemoryRegion
impl RefUnwindSafe for MemoryRegion
impl Unpin for MemoryRegion
impl UnsafeUnpin for MemoryRegion
impl UnwindSafe for MemoryRegion
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