pub struct DeviceContextMemory<'a> { /* private fields */ }Expand description
Guest-memory capability adapter for a routed PCI endpoint callback.
The endpoint supplies its registration-time DmaGrant; the runtime still
validates the grant and the current BME snapshot on every operation through
DeviceContext.
Implementations§
Source§impl<'a> DeviceContextMemory<'a>
impl<'a> DeviceContextMemory<'a>
Sourcepub fn new(context: &'a mut dyn DeviceContext, grant: &'a DmaGrant) -> Self
pub fn new(context: &'a mut dyn DeviceContext, grant: &'a DmaGrant) -> Self
Creates a scoped memory adapter for one endpoint callback.
Trait Implementations§
Source§impl GuestMemory for DeviceContextMemory<'_>
impl GuestMemory for DeviceContextMemory<'_>
Source§fn read(
&mut self,
guest_addr: GuestPhysAddr,
data: &mut [u8],
) -> VirtioResult<()>
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<()>
fn write(&mut self, guest_addr: GuestPhysAddr, data: &[u8]) -> VirtioResult<()>
Writes bytes starting at
guest_addr.Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DeviceContextMemory<'a>
impl<'a> !Send for DeviceContextMemory<'a>
impl<'a> !Sync for DeviceContextMemory<'a>
impl<'a> !UnwindSafe for DeviceContextMemory<'a>
impl<'a> Freeze for DeviceContextMemory<'a>
impl<'a> Unpin for DeviceContextMemory<'a>
impl<'a> UnsafeUnpin for DeviceContextMemory<'a>
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