#io-read #iterator #reader #byte-sequences #read

iter-read

A Read implementation for iterators over u8 and related types

8 releases (3 stable)

1.1.0 Aug 24, 2024
1.0.1 Nov 30, 2023
0.3.1 Jan 24, 2022
0.3.0 Jun 17, 2020
0.1.0 Apr 24, 2016

#109 in Rust patterns

Download history 41266/week @ 2024-12-02 41441/week @ 2024-12-09 37862/week @ 2024-12-16 17379/week @ 2024-12-23 23818/week @ 2024-12-30 38273/week @ 2025-01-06 40671/week @ 2025-01-13 42380/week @ 2025-01-20 43951/week @ 2025-01-27 66905/week @ 2025-02-03 68496/week @ 2025-02-10 72372/week @ 2025-02-17 87842/week @ 2025-02-24 91367/week @ 2025-03-03 95203/week @ 2025-03-10 82049/week @ 2025-03-17

358,850 downloads per month
Used in 144 crates (10 directly)

MIT/Apache

16KB
310 lines

iter-read

Build status Latest Version

Documentation

This crate is a small library that provides a type that implements std::io::Read for iterators over bytes (u8) and sequences of it, and also Result<u8, E>, Result<Vec<u8>, E> etc.

Installation

This crate works with Cargo and can be found on crates.io with a Cargo.toml like:

[dependencies]
iter-read = "1.0"

Requirements

Minimum supported Rust version is 1.58.0. No other dependencies.

Usage

A simple example:

use std::io::Read;
use iter_read::IterRead;
let source = vec![1, 2, 7, 42, 123];
let mut reader = IterRead::new(source.iter());
let mut buf = vec![0; 3];
reader.read_exact(&mut buf).unwrap();
assert_eq!(buf, b"\x01\x02\x07");

No runtime deps

Features