pub fn read_reply<R, T, E, F>(reader: &mut R, f: F) -> Result<T, E>
Expand description
Read a ShellAC Server reply without (necessarily) collecting.
use std::io::{self, BufReader};
shellac::read_reply::<_, _, shellac::Error, _>(&mut BufReader::new(io::stdin()), |suggestions| {
for (suggestion, description) in suggestions.map(Result::unwrap) {
println!("Suggestion: '{:?}' ({})", suggestion, description);
}
Ok(())
});