pub fn take_fn<F, R, I>(searcher: F) -> TakeFn<F, I>where
F: FnMut(I::Range) -> R,
R: Into<TakeRange>,
I: FullRangeStream,
I::Range: Range,Expand description
Searches the entire range using searcher and then consumes a range of Some(n).
If f can not find anything in the range it must return None/NotFound which indicates an end of input error.
If partial parsing is used the TakeRange enum can be returned instead of Option. By
returning TakeRange::NotFound(n) it indicates that the input can skip ahead until n
when parsing is next resumed.
See take_until_bytes for a usecase.