wasmtime_wasi_io/
bindings.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
wasmtime::component::bindgen!({
    path: "wit",
    trappable_imports: true,
    with: {
        "wasi:io/poll/pollable": crate::poll::DynPollable,
        "wasi:io/streams/input-stream": crate::streams::DynInputStream,
        "wasi:io/streams/output-stream": crate::streams::DynOutputStream,
        "wasi:io/error/error": crate::streams::Error,
    },
    async: {
        only_imports: [
            "poll",
            "[method]pollable.block",
            "[method]pollable.ready",
            "[method]input-stream.blocking-read",
            "[method]input-stream.blocking-skip",
            "[drop]input-stream",
            "[method]output-stream.blocking-splice",
            "[method]output-stream.blocking-flush",
            "[method]output-stream.blocking-write",
            "[method]output-stream.blocking-write-and-flush",
            "[method]output-stream.blocking-write-zeroes-and-flush",
            "[drop]output-stream",
        ]
    },
    trappable_error_type: {
        "wasi:io/streams/stream-error" => crate::streams::StreamError,
    }
});