read_collection 0.1.5

A collection of different variants of the `std::io::Read` trait.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::io::Empty;

use crate::{BufReadBack, ReadBack};

impl ReadBack for Empty {
    fn read_back(&mut self, _buf: &mut [u8]) -> std::io::Result<usize> {
        Ok(0)
    }
}

impl BufReadBack for Empty {
    fn read_back_fill_buf(&mut self) -> std::io::Result<&[u8]> {
        Ok(&[])
    }

    fn read_back_consume(&mut self, _amt: usize) {}
}