pub(crate) struct WasiInstanceGuard<'a> {
borrow: Ref<'static, WasiModuleTreeHandles>,
_pointer: &'a WasiInstanceHandlesPointer,
_inner: Rc<RefCell<WasiModuleTreeHandles>>,
}
Expand description
This non-sendable guard provides memory safe access to the WasiInstance object but only when it is constructed with certain constraints
Fields§
§borrow: Ref<'static, WasiModuleTreeHandles>
§_pointer: &'a WasiInstanceHandlesPointer
§_inner: Rc<RefCell<WasiModuleTreeHandles>>
Implementations§
Source§impl<'a> WasiInstanceGuard<'a>
impl<'a> WasiInstanceGuard<'a>
pub fn memory(self) -> WasiInstanceGuardMemory<'a>
Methods from Deref<Target = WasiModuleTreeHandles>§
Sourcepub(crate) fn main_module_instance_handles(&self) -> &WasiModuleInstanceHandles
pub(crate) fn main_module_instance_handles(&self) -> &WasiModuleInstanceHandles
Can be used to get the WasiModuleInstanceHandles
of the main module.
If access to the side modules’ instance handles is required, one must go
through the Linker
to retrieve the one they need.
Sourcepub(crate) fn static_module_instance_handles(
&self,
) -> Option<&WasiModuleInstanceHandles>
pub(crate) fn static_module_instance_handles( &self, ) -> Option<&WasiModuleInstanceHandles>
Helper function to get the instance handles of a static module, or fail otherwise. See comments on ensure_static_module for more details.
Sourcepub(crate) fn ensure_static_module(&self) -> Result<(), ()>
pub(crate) fn ensure_static_module(&self) -> Result<(), ()>
Helper function to ensure the module isn’t dynamically linked, needed since we only support a subset of WASIX functionality for dynamically linked modules. Specifically, anything that requires asyncify is not supported right now.
Sourcepub fn memory_view<'a>(
&'a self,
store: &'a (impl AsStoreRef + ?Sized),
) -> MemoryView<'a>
pub fn memory_view<'a>( &'a self, store: &'a (impl AsStoreRef + ?Sized), ) -> MemoryView<'a>
Providers safe access to the memory (it must be initialized before it can be used)
Sourcepub fn memory(&self) -> &Memory
pub fn memory(&self) -> &Memory
Providers safe access to the memory (it must be initialized before it can be used)
Sourcepub fn memory_clone(&self) -> Memory
pub fn memory_clone(&self) -> Memory
Copy the lazy reference so that when it’s initialized during the export phase, all the other references get a copy of it
pub fn linker(&self) -> Option<&Linker>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for WasiInstanceGuard<'a>
impl<'a> !RefUnwindSafe for WasiInstanceGuard<'a>
impl<'a> !Send for WasiInstanceGuard<'a>
impl<'a> !Sync for WasiInstanceGuard<'a>
impl<'a> Unpin for WasiInstanceGuard<'a>
impl<'a> !UnwindSafe for WasiInstanceGuard<'a>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more