MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / create

Method create

crates/c-api/include/wasmtime/exnref.hh:16–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace wasmtime {
15
16inline Result<ExnRef> ExnRef::create(Store::Context cx, const Tag &tag,
17 const std::vector<Val> &fields) {
18 wasmtime_exnref_t exn;
19 auto *error = wasmtime_exnref_new(
20 cx.capi(), &tag.capi(),
21 reinterpret_cast<const wasmtime_val_t *>(fields.data()), fields.size(),
22 &exn);
23 if (error != nullptr) {
24 return Error(error);
25 }
26 return ExnRef(exn);
27}
28
29/// Reads a field value by index.
30inline Result<Val> ExnRef::field(Store::Context cx, size_t index) const {

Callers

nothing calls this directly

Calls 6

wasmtime_exnref_newFunction · 0.85
ErrorClass · 0.70
ExnRefClass · 0.70
capiMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected