MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / makeRt

Function makeRt

runtime/src/rt.js:15–31  ·  view source on GitHub ↗
(getExports)

Source from the content-addressed store, hash-verified

13const TAG_BYTES = 4;
14
15export function makeRt(getExports) {
16 return {
17 decodeStr: (h) => decodeStr(getExports(), h),
18 decodeInt: (h) => decodeInt(getExports(), h),
19 decodeBool: (h) => decodeBool(getExports(), h),
20 decodeFloat: (h) => decodeFloat(getExports(), h),
21 encodeStr: (s) => encodeStr(getExports(), s),
22 encodeInt: (n) => encodeInt(getExports(), n),
23 encodeBool: (b) => encodeBool(getExports(), b),
24 encodeFloat: (f) => encodeFloat(getExports(), f),
25 encodeNone: () => getExports().host_edge_encode(TAG_NONE, 0, 0),
26 /* Tag-agnostic: decode any handle to a plain JS value; used by deferred host-call shuttling. */
27 decodeAny: (h) => decodeAny(getExports(), h),
28 /* Tag-agnostic: encode a plain JS value back into a handle. Integer numbers become INT; non-integer become FLOAT. */
29 encodeAny: (v) => encodeAny(getExports(), v),
30 };
31}
32
33function decodeBytes(exps, handle, expectedTag) {
34 const tagPtr = exps.wasm_alloc(4);

Callers 1

runFunction · 0.90

Calls 10

decodeStrFunction · 0.85
decodeIntFunction · 0.85
decodeBoolFunction · 0.85
decodeFloatFunction · 0.85
encodeStrFunction · 0.85
encodeIntFunction · 0.85
encodeBoolFunction · 0.85
encodeFloatFunction · 0.85
decodeAnyFunction · 0.85
encodeAnyFunction · 0.85

Tested by

no test coverage detected