Read/write vs stream

⚓ Rust    📅 2026-06-11    👤 surdeus    👁️ 1      

surdeus

Info

This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Read/write vs stream

What exactly is a "streaming" interface? Is it always meant "as opposed to read/write"?

From what I can tell, read/write pass in slices to buffers, that the application keeps ownership of, and return length and implement read/write traits (and thus can be used with things like {std,tokio}::io::copy()) while stream interfaces tend to take in or return entire buffers (where ownership is passed to/returned from the library), and the reading part implements Iterator (or equivalent).

XY: I'm developing an interface that allows transferring blobs, and the caller can request to be given a "file like" object (implements read/write traits) or "stream like" object (implements Iterator for the receiver), and I'm wondering if I'm using the appropriate (read: non-confusing) terminology.

1 post - 1 participant

Read full topic

🏷️ Rust_feed