-
Notifications
You must be signed in to change notification settings - Fork 256
Closed
Description
I am studying the new async support and trying to figure out the rationale behind the WIT stream<T> translating into Rust stream<Vec<T>> instead of stream<T>.
A common use of async streams in WIT is for sockets and http, where a stream of bytes (chunks) is needed. In this case stream<u8> covers the need, but this could also be achieved by defining a stream<list<T>> in WIT which would translate to stream<Vec<u8>> in Rust. On the other hand, a stream of complex records which should be processed individually cannot be expressed with a WIT stream, as this would result in a stream of complex records chunks.
Wouldn't it be more universal to define as WIT stream<T> as a Rust stream<T>, to cover all use cases?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels