Class: Wasmtime::Component::Instance
- Inherits:
-
Object
- Object
- Wasmtime::Component::Instance
- Defined in:
- ext/src/ruby_api/component/instance.rs
Overview
Represents a WebAssembly component instance.
Instance Method Summary collapse
-
#get_func(handle) ⇒ Func?
Retrieves a Wasm function from the component instance.
Instance Method Details
#get_func(handle) ⇒ Func?
Retrieves a Wasm function from the component instance.
57 58 59 60 61 62 63 64 |
# File 'ext/src/ruby_api/component/instance.rs', line 57
pub fn get_func(rb_self: Obj<Self>, handle: Value) -> Result<Option<Func>, Error> {
let func = rb_self
.export_index(handle)?
.and_then(|index| rb_self.inner.get_func(rb_self.store.context_mut(), index))
.map(|inner| Func::from_inner(inner, rb_self, rb_self.store));
Ok(func)
}
|