wit-bindgen icon indicating copy to clipboard operation
wit-bindgen copied to clipboard

Cannot precisely control read capacity of `stream` in Rust

Open alexcrichton opened this issue 10 months ago • 0 comments

The stream type in WIT (note no type parameter) is modeled in Rust as StreamReader<()>. This takes a Vec<()> to read into but the capacity of Vec<()> is always usize::MAX. This means there's no way to precisely control the capacity of reads of stream in Rust.

alexcrichton avatar May 19 '25 19:05 alexcrichton