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

Method create

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

Source from the content-addressed store, hash-verified

16namespace wasmtime {
17
18inline Result<ArrayRef> ArrayRef::create(Store::Context cx,
19 const ArrayRefPre &pre,
20 const Val &elem, uint32_t len) {
21 wasmtime_arrayref_t out;
22 auto *err =
23 wasmtime_arrayref_new(cx.capi(), pre.capi(), elem.capi(), len, &out);
24 if (err)
25 return Result<ArrayRef>(Error(err));
26 return Result<ArrayRef>(ArrayRef(out));
27}
28
29inline Result<Val> ArrayRef::get(Store::Context cx, uint32_t index) const {
30 wasmtime_val_t out;

Callers

nothing calls this directly

Calls 4

wasmtime_arrayref_newFunction · 0.85
ErrorClass · 0.70
ArrayRefClass · 0.70
capiMethod · 0.45

Tested by

no test coverage detected