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

Method create

crates/c-api/include/wasmtime/structref.hh:18–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace wasmtime {
17
18inline Result<StructRef> StructRef::create(Store::Context cx,
19 const StructRefPre &pre,
20 const std::vector<Val> &fields) {
21 wasmtime_structref_t out;
22 auto *err = wasmtime_structref_new(
23 cx.capi(), pre.capi(),
24 reinterpret_cast<const wasmtime_val_t *>(fields.data()), fields.size(),
25 &out);
26 if (err)
27 return Result<StructRef>(Error(err));
28 return Result<StructRef>(StructRef(out));
29}
30
31inline Result<Val> StructRef::field(Store::Context cx, size_t index) const {
32 wasmtime_val_t out;

Callers

nothing calls this directly

Calls 6

wasmtime_structref_newFunction · 0.85
ErrorClass · 0.70
StructRefClass · 0.70
capiMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected