pub struct VMMemory {
pub instance_ref: Option<WeakOrStrongInstanceRef>,
/* private fields */
}Expand description
A memory export value.
Fields§
§instance_ref: Option<WeakOrStrongInstanceRef>A “reference” to the instance through the
InstanceRef. None if it is a host memory.
Implementations§
Source§impl VMMemory
impl VMMemory
Sourcepub fn new(
from: Arc<LinearMemory>,
instance_ref: Option<WeakOrStrongInstanceRef>,
) -> Self
pub fn new( from: Arc<LinearMemory>, instance_ref: Option<WeakOrStrongInstanceRef>, ) -> Self
Create a new VMMemory
Sourcepub fn from(&self) -> &Arc<LinearMemory>
pub fn from(&self) -> &Arc<LinearMemory>
Retrieve the memory this export is having
Sourcepub fn ty(&self) -> MemoryType
pub fn ty(&self) -> MemoryType
Get the type for this exported memory
Sourcepub fn style(&self) -> &MemoryStyle
pub fn style(&self) -> &MemoryStyle
Get the style for this exported memory
Sourcepub fn same(&self, other: &Self) -> bool
pub fn same(&self, other: &Self) -> bool
Returns whether or not the two VMMemorys refer to the same Memory.
Sourcepub fn upgrade_instance_ref(&mut self) -> Option<()>
pub fn upgrade_instance_ref(&mut self) -> Option<()>
Converts the stored instance ref into a strong InstanceRef if it is weak.
Returns None if it cannot be upgraded.
Trait Implementations§
impl Send for VMMemory
§Safety
This is correct because there is no non-threadsafe logic directly in this type;
correct use of the raw memory from multiple threads via definition requires unsafe
and is the responsibility of the user of this type.
impl Sync for VMMemory
§Safety
This is correct because the values directly in definition should be considered immutable
and the type is both Send and Clone (thus marking it Sync adds no new behavior, it
only makes this type easier to use)
Auto Trait Implementations§
impl Freeze for VMMemory
impl !RefUnwindSafe for VMMemory
impl Unpin for VMMemory
impl !UnwindSafe for VMMemory
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.