bytecodealliance / bytecodealliance/wasm-tools

Streaming writing/encoding with io::Write

Open
#778 4 comments 0 reactions 0 assignees View on GitHub
wasmparser
Dominant language
Rust
Stars
1.8k
Forks
351
Avg merge
1d 6h
Merged PRs (30d)
46

Description

Similar to [this prior question](https://github.com/bytecodealliance/wasm-tools/issues/328) on streaming reading with `wasmparser`, I am wondering if it is possible to do *streaming encoding* with `wasm-encoder`?

Right now, the central trait seems to be [`wasm_encoder::Encode`](https://docs.rs/wasm-encoder/latest/wasm_encoder/trait.Encode.html), which takes the sink as a `&mut Vec`. Would it be possible to get rid of that trait and instead serialize to any `impl io::Write`? That should strictly be more general, as `io::Write` is already implemented in the standard library for `Vec` anyway.

Thanks a lot for the great selection of crates!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.