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

bufstream-fresh

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

2 releases

0.3.1 Feb 10, 2024
0.3.0 May 7, 2023

#31 in #io-stream

Download history 94/week @ 2024-07-22 128/week @ 2024-07-29 141/week @ 2024-08-05 134/week @ 2024-08-12 65/week @ 2024-08-19 142/week @ 2024-08-26 98/week @ 2024-09-02 102/week @ 2024-09-09 51/week @ 2024-09-16 75/week @ 2024-09-23 127/week @ 2024-09-30 45/week @ 2024-10-07 74/week @ 2024-10-14 69/week @ 2024-10-21 40/week @ 2024-10-28 125/week @ 2024-11-04

313 downloads per month
Used in 4 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