| 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 |