Struct dbs_address_space::GuestRegionRaw
source · pub struct GuestRegionRaw<B = ()> { /* private fields */ }
Expand description
Guest memory region for virtio-fs DAX window.
Implementations§
Trait Implementations§
source§impl<B: Bitmap> Bytes<MemoryRegionAddress> for GuestRegionRaw<B>
impl<B: Bitmap> Bytes<MemoryRegionAddress> for GuestRegionRaw<B>
source§fn write(&self, buf: &[u8], addr: MemoryRegionAddress) -> Result<usize>
fn write(&self, buf: &[u8], addr: MemoryRegionAddress) -> Result<usize>
Writes a slice into the container at
addr
. Read moresource§fn read(&self, buf: &mut [u8], addr: MemoryRegionAddress) -> Result<usize>
fn read(&self, buf: &mut [u8], addr: MemoryRegionAddress) -> Result<usize>
Reads data from the container at
addr
into a slice. Read moresource§fn write_slice(&self, buf: &[u8], addr: MemoryRegionAddress) -> Result<()>
fn write_slice(&self, buf: &[u8], addr: MemoryRegionAddress) -> Result<()>
Writes the entire content of a slice into the container at
addr
. Read moresource§fn read_slice(&self, buf: &mut [u8], addr: MemoryRegionAddress) -> Result<()>
fn read_slice(&self, buf: &mut [u8], addr: MemoryRegionAddress) -> Result<()>
Reads data from the container at
addr
to fill an entire slice. Read moresource§fn read_from<F>(
&self,
addr: MemoryRegionAddress,
src: &mut F,
count: usize
) -> Result<usize>where
F: Read,
fn read_from<F>( &self, addr: MemoryRegionAddress, src: &mut F, count: usize ) -> Result<usize>where F: Read,
source§fn read_exact_from<F>(
&self,
addr: MemoryRegionAddress,
src: &mut F,
count: usize
) -> Result<()>where
F: Read,
fn read_exact_from<F>( &self, addr: MemoryRegionAddress, src: &mut F, count: usize ) -> Result<()>where F: Read,
source§fn write_to<F>(
&self,
addr: MemoryRegionAddress,
dst: &mut F,
count: usize
) -> Result<usize>where
F: Write,
fn write_to<F>( &self, addr: MemoryRegionAddress, dst: &mut F, count: usize ) -> Result<usize>where F: Write,
source§fn write_all_to<F>(
&self,
addr: MemoryRegionAddress,
dst: &mut F,
count: usize
) -> Result<()>where
F: Write,
fn write_all_to<F>( &self, addr: MemoryRegionAddress, dst: &mut F, count: usize ) -> Result<()>where F: Write,
source§fn store<T: AtomicAccess>(
&self,
val: T,
addr: MemoryRegionAddress,
order: Ordering
) -> Result<()>
fn store<T: AtomicAccess>( &self, val: T, addr: MemoryRegionAddress, order: Ordering ) -> Result<()>
Atomically store a value at the specified address.
source§fn load<T: AtomicAccess>(
&self,
addr: MemoryRegionAddress,
order: Ordering
) -> Result<T>
fn load<T: AtomicAccess>( &self, addr: MemoryRegionAddress, order: Ordering ) -> Result<T>
Atomically load a value from the specified address.
source§impl<B: Debug> Debug for GuestRegionRaw<B>
impl<B: Debug> Debug for GuestRegionRaw<B>
source§impl<B: Bitmap> GuestMemoryRegion for GuestRegionRaw<B>
impl<B: Bitmap> GuestMemoryRegion for GuestRegionRaw<B>
source§fn len(&self) -> GuestUsize
fn len(&self) -> GuestUsize
Returns the size of the region.
source§fn start_addr(&self) -> GuestAddress
fn start_addr(&self) -> GuestAddress
Returns the minimum (inclusive) address managed by the region.
source§fn get_host_address(&self, addr: MemoryRegionAddress) -> Result<*mut u8>
fn get_host_address(&self, addr: MemoryRegionAddress) -> Result<*mut u8>
Returns the host virtual address corresponding to the region address. Read more
source§fn file_offset(&self) -> Option<&FileOffset>
fn file_offset(&self) -> Option<&FileOffset>
Returns information regarding the file and offset backing this memory region.
source§unsafe fn as_slice(&self) -> Option<&[u8]>
unsafe fn as_slice(&self) -> Option<&[u8]>
Returns a slice corresponding to the data in the region. Read more
source§unsafe fn as_mut_slice(&self) -> Option<&mut [u8]>
unsafe fn as_mut_slice(&self) -> Option<&mut [u8]>
Returns a mutable slice corresponding to the data in the region. Read more
source§fn get_slice(
&self,
offset: MemoryRegionAddress,
count: usize
) -> Result<VolatileSlice<'_, BS<'_, B>>>
fn get_slice( &self, offset: MemoryRegionAddress, count: usize ) -> Result<VolatileSlice<'_, BS<'_, B>>>
source§fn is_hugetlbfs(&self) -> Option<bool>
fn is_hugetlbfs(&self) -> Option<bool>
Show if the region is based on the
HugeTLBFS
.
Returns Some(true) if the region is backed by hugetlbfs.
None represents that no information is available. Read moresource§fn last_addr(&self) -> GuestAddress
fn last_addr(&self) -> GuestAddress
Returns the maximum (inclusive) address managed by the region.
source§fn check_address(&self, addr: MemoryRegionAddress) -> Option<MemoryRegionAddress>
fn check_address(&self, addr: MemoryRegionAddress) -> Option<MemoryRegionAddress>
Returns the given address if it is within this region.
source§fn address_in_range(&self, addr: MemoryRegionAddress) -> bool
fn address_in_range(&self, addr: MemoryRegionAddress) -> bool
Returns
true
if the given address is within this region.source§fn checked_offset(
&self,
base: MemoryRegionAddress,
offset: usize
) -> Option<MemoryRegionAddress>
fn checked_offset( &self, base: MemoryRegionAddress, offset: usize ) -> Option<MemoryRegionAddress>
Returns the address plus the offset if it is in this region.
source§fn to_region_addr(&self, addr: GuestAddress) -> Option<MemoryRegionAddress>
fn to_region_addr(&self, addr: GuestAddress) -> Option<MemoryRegionAddress>
Tries to convert an absolute address to a relative address within this region. Read more
source§fn as_volatile_slice(
&self
) -> Result<VolatileSlice<'_, <Self::B as WithBitmapSlice<'_>>::S>, Error>
fn as_volatile_slice( &self ) -> Result<VolatileSlice<'_, <Self::B as WithBitmapSlice<'_>>::S>, Error>
Gets a slice of memory for the entire region that supports volatile access. Read more