I/O Streams
Overview:
- Reliable in-order delivery of bytes
- or in the future, of arbitrary type
- Examples: sockets, pipes, character devices, files*
- Prototype: https://crates.io/crates/io-streams, https://crates.io/crates/nameless
Operations:
read(input)write(output)skip(input) - likereadbut discards datawrite_zeros(output) - likewritebut just writes zerosflush(output) - flush buffers, report errorsmedia_type- return astringwith the IANA Media Type (eg. "image/jpeg")pseudonym- return a handle to an identifierwrite_pseudonym- (output) write the name of a pseudonym to the outputforward-readfrom an input andwritethe data to another 💨
Constructors:
pipenull- (output) bit bucketfrom_array- form a stream from an I/O array at a given offset