Skip to main content

AddressSpaceMemory

Struct AddressSpaceMemory 

Source
pub struct AddressSpaceMemory<'a, T> { /* private fields */ }
Expand description

Adapter for existing address-space accessors used by host tests and standalone device-model users.

Implementations§

Source§

impl<'a, T> AddressSpaceMemory<'a, T>

Source

pub const fn new(accessor: &'a T) -> Self

Wraps one address-space accessor for a scoped queue operation.

Trait Implementations§

Source§

impl<T: GuestMemoryAccessor> GuestMemory for AddressSpaceMemory<'_, T>

Source§

fn read( &mut self, guest_addr: GuestPhysAddr, data: &mut [u8], ) -> VirtioResult<()>

Reads bytes starting at guest_addr.
Source§

fn write(&mut self, guest_addr: GuestPhysAddr, data: &[u8]) -> VirtioResult<()>

Writes bytes starting at guest_addr.

Auto Trait Implementations§

§

impl<'a, T> Freeze for AddressSpaceMemory<'a, T>
where &'a T: Freeze,

§

impl<'a, T> RefUnwindSafe for AddressSpaceMemory<'a, T>

§

impl<'a, T> Send for AddressSpaceMemory<'a, T>
where &'a T: Send,

§

impl<'a, T> Sync for AddressSpaceMemory<'a, T>
where &'a T: Sync,

§

impl<'a, T> Unpin for AddressSpaceMemory<'a, T>
where &'a T: Unpin,

§

impl<'a, T> UnsafeUnpin for AddressSpaceMemory<'a, T>

§

impl<'a, T> UnwindSafe for AddressSpaceMemory<'a, T>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.