[][src]Function nyx::write::call

Important traits for Writer<W, F>
pub fn call<W: Write, F: FnMut(Bps)>(writer: W, f: F) -> Writer<W, F>

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

Examples

use std::io;

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