[][src]Function nyx::read::call

Important traits for Reader<R, F>
pub fn call<R: Read, F: FnMut(Bps)>(reader: R, f: F) -> Reader<R, F>

Creates a reader that yields the bytes by calling the provided function.

Examples

use std::io;

fn main() {
    io::copy(
        &mut nyx::read::call(io::repeat(0), |bps| println!("B/s: {}", bps)),
        &mut io::sink(),
    )
    .unwrap();
}