Struct HostMemory

Source
#[repr(align(4096))]
pub struct HostMemory { /* private fields */ }

Implementations§

Source§

impl HostMemory

Source

pub fn new() -> Self

Source

pub fn mem_area_strat(align: u32) -> BoxedStrategy<MemArea>

Source

pub fn invert(regions: &MemAreas) -> MemAreas

Takes a sorted list or memareas, and gives a sorted list of memareas covering the parts of memory not covered by the previous

Source

pub fn byte_slice_strat(size: u32, exclude: &MemAreas) -> BoxedStrategy<MemArea>

Trait Implementations§

Source§

impl GuestMemory for HostMemory

Source§

fn base(&self) -> (*mut u8, u32)

Returns the base allocation of this guest memory, located in host memory. Read more
Source§

fn validate_size_align( &self, offset: u32, align: usize, len: u32, ) -> Result<*mut u8, GuestError>

Validates a guest-relative pointer given various attributes, and returns the corresponding host pointer. Read more
Source§

fn ptr<'a, T>(&'a self, offset: <T as Pointee>::Pointer) -> GuestPtr<'a, T>
where Self: Sized, T: Pointee + ?Sized,

Convenience method for creating a GuestPtr at a particular offset. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointee for T

Source§

type Pointer = u32

Source§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.