Struct vm_memory::atomic::GuestMemoryLoadGuard
source · pub struct GuestMemoryLoadGuard<M: GuestMemory> { /* private fields */ }
Expand description
A guard that provides temporary access to a GuestMemoryAtomic
. This
object is returned from the memory()
method. It dereference to
a snapshot of the GuestMemory
, so it can be used transparently to
access memory.
Implementations§
source§impl<M: GuestMemory> GuestMemoryLoadGuard<M>
impl<M: GuestMemory> GuestMemoryLoadGuard<M>
sourcepub fn into_inner(self) -> Arc<M>
pub fn into_inner(self) -> Arc<M>
Make a clone of the held pointer and returns it. This is more expensive than just using the snapshot, but it allows to hold on to the snapshot outside the scope of the guard. It also allows writers to proceed, so it is recommended if the reference must be held for a long time (including for caching purposes).
Trait Implementations§
source§impl<M: GuestMemory> Clone for GuestMemoryLoadGuard<M>
impl<M: GuestMemory> Clone for GuestMemoryLoadGuard<M>
source§impl<M: Debug + GuestMemory> Debug for GuestMemoryLoadGuard<M>
impl<M: Debug + GuestMemory> Debug for GuestMemoryLoadGuard<M>
Auto Trait Implementations§
impl<M> RefUnwindSafe for GuestMemoryLoadGuard<M>where
M: RefUnwindSafe,
impl<M> Send for GuestMemoryLoadGuard<M>
impl<M> Sync for GuestMemoryLoadGuard<M>
impl<M> Unpin for GuestMemoryLoadGuard<M>
impl<M> UnwindSafe for GuestMemoryLoadGuard<M>where
M: RefUnwindSafe,
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
source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load
.