pub fn instantiate_wasi_with_context(
    global_exports: Rc<RefCell<HashMap<String, Option<wasmtime_runtime::Export>>>>,
    wasi_ctx: WasiCtx,
) -> Result<InstanceHandle, InstantiationError> {
    let pointer_type = types::Type::triple_pointer_type(&HOST);
    let mut module = Module::new();
    let mut finished_functions = PrimaryMap::new();
    let call_conv = isa::CallConv::triple_default(&HOST);

    // This function is defined in the macro invocation of
    // `define_add_wrappers_to_module` below. For more information about how
    // this works it'd recommended to read the source in
    // `crates/wasi-common/wig/src/wasi.rs`.
    add_wrappers_to_module(
        &mut module,
        &mut finished_functions,
        call_conv,
        pointer_type,
    );

    let imports = Imports::none();
    let data_initializers = Vec::new();
    let signatures = PrimaryMap::new();

    InstanceHandle::new(
        Rc::new(module),
        global_exports,
        finished_functions.into_boxed_slice(),
        imports,
        &data_initializers,
        signatures.into_boxed_slice(),
        None,
        Box::new(wasi_ctx),
    )
}
/// Return an instance implementing the "wasi" interface.
///
/// The wasi context is configured by
Return an instance implementing the "wasi" interface.
The wasi context is configured by
Return an instance implementing the " wasi " interface . The wasi context is configured by
pub fn instantiate_wasi_with_context(
    global_exports: Rc<RefCell<HashMap<String, Option<wasmtime_runtime::Export>>>>,
    wasi_ctx: WasiCtx,
) -> Result<InstanceHandle, InstantiationError> {
    let pointer_type = types::Type::triple_pointer_type(&HOST);
    let mut module = Module::new();
    let mut finished_functions = PrimaryMap::new();
    let call_conv = isa::CallConv::triple_default(&HOST);
    // This function is defined in the macro invocation of
    // `define_add_wrappers_to_module` below. For more information about how
    // this works it'd recommended to read the source in
    // `crates/wasi-common/wig/src/wasi.rs`.
    add_wrappers_to_module(
        &mut module,
        &mut finished_functions,
        call_conv,
        pointer_type,
    );
    let imports = Imports::none();
    let data_initializers = Vec::new();
    let signatures = PrimaryMap::new();
    InstanceHandle::new(
        Rc::new(module),
        global_exports,
        finished_functions.into_boxed_slice(),
        imports,
        &data_initializers,
        signatures.into_boxed_slice(),
        None,
        Box::new(wasi_ctx),
    )
}
pub fn instantiate_wasi_with_context ( global_exports : Rc < RefCell < HashMap < String , Option < wasmtime_runtime :: Export > > > > , wasi_ctx : WasiCtx , ) -> Result < InstanceHandle , InstantiationError > { let pointer_type = types :: Type :: triple_pointer_type ( & HOST ) ; let mut module = Module :: new ( ) ; let mut finished_functions = PrimaryMap :: new ( ) ; let call_conv = isa :: CallConv :: triple_default ( & HOST ) ; // This function is defined in the macro invocation of // `define_add_wrappers_to_module` below. For more information about how // this works it'd recommended to read the source in // `crates/wasi-common/wig/src/wasi.rs`. add_wrappers_to_module ( & mut module , & mut finished_functions , call_conv , pointer_type , ) ; let imports = Imports :: none ( ) ; let data_initializers = Vec :: new ( ) ; let signatures = PrimaryMap :: new ( ) ; InstanceHandle :: new ( Rc :: new ( module ) , global_exports , finished_functions . into_boxed_slice ( ) , imports , & data_initializers , signatures . into_boxed_slice ( ) , None , Box :: new ( wasi_ctx ) , ) }
Return an instance implementing the "wasi" interface.
Return an instance implementing the " wasi " interface .
global_exports
Rc<RefCell<HashMap<String, Option<wasmtime_runtime::Export>>>>
wasi_ctx
WasiCtx