Type Definition wasmtime_wasi_http::streams::InputStream

source ·
pub type InputStream = u32;
Expand description

An input bytestream. In the future, this will be replaced by handle types.

This conceptually represents a stream<u8, _>. It’s temporary scaffolding until component-model’s async features are ready.

input-streams are non-blocking to the extent practical on underlying platforms. I/O operations always return promptly; if fewer bytes are promptly available than requested, they return the number of bytes promptly available, which could even be zero. To wait for data to be available, use the subscribe-to-input-stream function to obtain a pollable which can be polled for using wasi_poll.

And at present, it is a u32 instead of being an actual handle, until the wit-bindgen implementation of handles and resources is ready.

This represents a resource.