Stream: git-wasmtime

Topic: wasmtime / issue #3613 How do I pass JSON/Map/Vec<u8> int...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 17 2021 at 02:49):

fengqi2019 opened issue #3613:

hello, Actually, I wanted tochange this function to wasi :

fn wasi_fn(
    _topic: &str,
    params: Value,
    _context: &HashMap<String, String>,
) -> Result<Vec<u8>>

so, i think if i can pass json/map into wasi, or i pass Vec<u8> then will be transformed to json/map in wasi.Does the idea work?

view this post on Zulip Wasmtime GitHub notifications bot (Dec 20 2021 at 16:36):

alexcrichton commented on issue #3613:

Right-this-red-hot-second I don't think this will work with WASI, but with interface types and an implementation like wit-bindgen everything except the hash map should work.

Unfortunately this is still somewhat nontrivial to implement today, but for following this work I'd recommend following the interface-types and wit-bindgen repositories.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 20 2021 at 16:36):

alexcrichton closed issue #3613:

hello, Actually, I wanted tochange this function to wasi :

fn wasi_fn(
    _topic: &str,
    params: Value,
    _context: &HashMap<String, String>,
) -> Result<Vec<u8>>

so, i think if i can pass json/map into wasi, or i pass Vec<u8> then will be transformed to json/map in wasi.Does the idea work?


Last updated: Nov 22 2024 at 17:03 UTC