Function handy_io::pattern::read::until [] [src]

pub fn until<F, T>(f: F) -> Until<F, T> where
    F: Fn(&[u8], bool) -> Result<Option<T>>, 

Makes Until pattern which continues reading until F returns Ok(Some(T)) or Err(..).

F will be called with current read buffer (the first argument) and is_eos flag (the second argument).

If is_eos == true and F returns Ok(None), it will result in the UnexpectedEof error.