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
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 mut self,
store: &'a mut impl AsStoreMut
) -> &'a mut WasiEnv
pub fn data_mut<'a>( &'a mut 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>
) -> Result<(), ExportError>
pub fn initialize_with_memory( &mut self, store: &mut impl AsStoreMut, instance: Instance, memory: Option<Memory> ) -> 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.