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>

source

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>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<M: Debug + GuestMemory> Debug for GuestMemoryLoadGuard<M>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<M: GuestMemory> Deref for GuestMemoryLoadGuard<M>

§

type Target = M

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.

Auto Trait Implementations§

§

impl<M> RefUnwindSafe for GuestMemoryLoadGuard<M>where M: RefUnwindSafe,

§

impl<M> Send for GuestMemoryLoadGuard<M>where M: Send + Sync,

§

impl<M> Sync for GuestMemoryLoadGuard<M>where M: Send + Sync,

§

impl<M> Unpin for GuestMemoryLoadGuard<M>

§

impl<M> UnwindSafe for GuestMemoryLoadGuard<M>where M: RefUnwindSafe,

Blanket Implementations§

source§

impl<T, A, P> Access<T> for Pwhere A: Access<T> + ?Sized, P: Deref<Target = A>,

§

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more
source§

fn load(&self) -> <P as Access<T>>::Guard

The loading method. Read more
source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T, A> DynAccess<T> for Awhere A: Access<T>, <A as Access<T>>::Guard: 'static,

source§

fn load(&self) -> DynGuard<T>

The equivalent of Access::load.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.