#network #io #stream #buffer

bufstream-fresh

Fork of the bufstream crate. Buffered I/O for streams where each read/write half is separately buffered.

1 unstable release

0.3.0 May 7, 2023

#1519 in Network programming

Download history 111/week @ 2023-06-06 101/week @ 2023-06-13 73/week @ 2023-06-20 26/week @ 2023-06-27 41/week @ 2023-07-04 17/week @ 2023-07-11 28/week @ 2023-07-18 24/week @ 2023-07-25 17/week @ 2023-08-01 24/week @ 2023-08-08 25/week @ 2023-08-15 38/week @ 2023-08-22 46/week @ 2023-08-29 39/week @ 2023-09-05 20/week @ 2023-09-12 17/week @ 2023-09-19

126 downloads per month
Used in 3 crates (via mailin-embedded)

MIT/Apache

10KB
150 lines

bufstream-fresh

This is a fork of the bufstream crate.

Buffered I/O streams for reading/writing.

Documentation

Usage

[dependencies]
bufstream-fresh = "0.3"

lib.rs:

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();

No runtime deps