Crate bufstream_fresh

Source
Expand description

A crate for separately buffered streams.

This crate provides a BufStream type which provides buffering of both the reading and writing halves of a Read + Write type. Each half is completely independently buffered of the other, which may not always be desired. For example BufStream<File> may have surprising semantics.

use std::io::prelude::*;
use std::net::TcpStream;
use bufstream_fresh::BufStream;


let stream = TcpStream::connect("localhost:4000").unwrap();
let mut buf = BufStream::new(stream);
buf.read(&mut [0; 1024]).unwrap();
buf.write(&[0; 1024]).unwrap();

Structsยง

BufStream
Wraps a Stream and buffers input and output to and from it.
IntoInnerError
An error returned by into_inner which combines an error that happened while writing out the buffer, and the buffered writer object which may be used to recover from the condition.