Crate read_with[][src]

Create a Read object that gets its data incrementally from a function.

This lets you read from an a vector of vectors or create a reader that gets blocks from a database or other data source.

Example:

let many_strings = ["one", "two", "three"];
let mut pos = 0;
std::io::copy(
    &mut read_with::ReadWith::new(
        ||
        {
            if pos == many_strings.len() { return None; }
            let o = many_strings[pos];
            pos+=1;
            Some(o)
        }
    ),
    &mut std::io::stdout(),
).unwrap();

Structs

ReadWith

An object that implements the Read trait