Function peek_input_until_verdict
pub async fn peek_input_until_verdict<R, O, P>(
reader: &mut R,
buffer: &mut [u8],
offset: usize,
waiter: &mut PeekWaiter<'_>,
predicate: P,
) -> PeekOutput<O>Available on crate feature
std only.Expand description
Read into the fixed buffer until predicate decides, peeking stops, or
the waiter cuts the peek short.
The first offset bytes of buffer are an earlier peek (clamped to its
length); the predicate classifies them before reading. Peeking stops when:
predicatereturnsPeekVerdict::MatchorPeekVerdict::Reject, in which case no further read is issued;- the reader returns EOF or an error;
- the
waitercuts the peek short, seePeekWaiter; bufferis full.