MCPcopy Create free account
hub / github.com/bluejekyll/wasmtime-java / load_from_args

Method load_from_args

wasmtime-jni/src/ty/byte_slice.rs:103–117  ·  view source on GitHub ↗
(mut args: impl Iterator<Item = Val>)

Source from the content-addressed store, hash-verified

101 }
102
103 fn load_from_args(mut args: impl Iterator<Item = Val>) -> Result<Self, anyhow::Error> {
104 let ptr = args
105 .next()
106 .ok_or_else(|| anyhow!("missing ptr arg"))?
107 .i32()
108 .ok_or_else(|| anyhow!("ptr not i32"))?;
109
110 let len = args
111 .next()
112 .ok_or_else(|| anyhow!("missing ptr arg"))?
113 .i32()
114 .ok_or_else(|| anyhow!("ptr not i32"))?;
115
116 unsafe { Ok(WasmSlice::new(ptr, len)) }
117 }
118
119 fn matches_arg_tys(mut tys: impl Iterator<Item = ValType>) -> anyhow::Result<()> {
120 // offset

Callers

nothing calls this directly

Calls 1

i32Method · 0.80

Tested by

no test coverage detected