#buffer #networking #io-stream #stream-io

bufstream-fresh

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

3 unstable releases

Uses new Rust 2024

new 0.4.0 Apr 20, 2025
0.3.1 Feb 10, 2024
0.3.0 May 7, 2023

#2 in #stream-io

Download history 31/week @ 2024-12-28 27/week @ 2025-01-04 73/week @ 2025-01-11 42/week @ 2025-01-18 64/week @ 2025-01-25 83/week @ 2025-02-01 45/week @ 2025-02-08 48/week @ 2025-02-15 50/week @ 2025-02-22 56/week @ 2025-03-01 40/week @ 2025-03-08 117/week @ 2025-03-15 97/week @ 2025-03-22 72/week @ 2025-03-29 36/week @ 2025-04-05 42/week @ 2025-04-12

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

MIT/Apache

10KB
150 lines

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

bufstream-fresh

This is a fork of the bufstream crate.

Buffered I/O streams for reading/writing.

Documentation

Usage

[dependencies]
bufstream-fresh = "0.3"

No runtime deps