Struct wasmer_wasix::WasiFunctionEnv
source · pub struct WasiFunctionEnv {
pub env: FunctionEnv<WasiEnv>,
}
Fields§
§env: FunctionEnv<WasiEnv>
Implementations§
source§impl WasiFunctionEnv
impl WasiFunctionEnv
pub fn new(store: &mut impl AsStoreMut, env: WasiEnv) -> Self
pub fn new_with_store( module: Module, env: WasiEnv, snapshot: Option<&InstanceSnapshot>, spawn_type: SpawnMemoryType<'_>, update_layout: bool ) -> Result<(Self, Store), WasiThreadError>
sourcepub fn import_object(
&self,
store: &mut impl AsStoreMut,
module: &Module
) -> Result<Imports, WasiError>
pub fn import_object( &self, store: &mut impl AsStoreMut, module: &Module ) -> Result<Imports, WasiError>
Get an Imports
for a specific version of WASI detected in the module.
sourcepub fn data<'a>(&'a self, store: &'a impl AsStoreRef) -> &'a WasiEnv
pub fn data<'a>(&'a self, store: &'a impl AsStoreRef) -> &'a WasiEnv
Gets a reference to the WasiEnvironment
sourcepub fn data_mut<'a>(&'a self, store: &'a mut impl AsStoreMut) -> &'a mut WasiEnv
pub fn data_mut<'a>(&'a self, store: &'a mut impl AsStoreMut) -> &'a mut WasiEnv
Gets a mutable- reference to the host state in this context.
sourcepub fn initialize(
&mut self,
store: &mut impl AsStoreMut,
instance: Instance
) -> Result<(), ExportError>
pub fn initialize( &mut self, store: &mut impl AsStoreMut, instance: Instance ) -> Result<(), ExportError>
Initializes the WasiEnv using the instance exports (this must be executed before attempting to use it) (as the stores can not by themselves be passed between threads we can store the module in a thread-local variables and use it later - for multithreading)
sourcepub fn initialize_with_memory(
&mut self,
store: &mut impl AsStoreMut,
instance: Instance,
memory: Option<Memory>,
update_layout: bool
) -> Result<(), ExportError>
pub fn initialize_with_memory( &mut self, store: &mut impl AsStoreMut, instance: Instance, memory: Option<Memory>, update_layout: bool ) -> Result<(), ExportError>
Initializes the WasiEnv using the instance exports and a provided optional memory (this must be executed before attempting to use it) (as the stores can not by themselves be passed between threads we can store the module in a thread-local variables and use it later - for multithreading)
sourcepub fn import_object_for_all_wasi_versions(
&self,
store: &mut impl AsStoreMut,
module: &Module
) -> Result<Imports, WasiError>
pub fn import_object_for_all_wasi_versions( &self, store: &mut impl AsStoreMut, module: &Module ) -> Result<Imports, WasiError>
Like import_object
but containing all the WASI versions detected in
the module.
Trait Implementations§
source§impl Clone for WasiFunctionEnv
impl Clone for WasiFunctionEnv
source§fn clone(&self) -> WasiFunctionEnv
fn clone(&self) -> WasiFunctionEnv
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more