Skip to main content

peek_input_until_verdict

Function peek_input_until_verdict 

pub fn peek_input_until_verdict<R, O, P>(
    reader: &mut R,
    buffer: &mut [u8],
    timeout: Option<Duration>,
    predicate: P,
) -> impl Future<Output = PeekOutput<O>>
where R: AsyncRead + Unpin, P: Fn(&[u8]) -> PeekVerdict<O>,
Available on crate feature std only.
Expand description

Fail-fast variant of peek_input_until using a PeekVerdict predicate.

Uses the same buffer-derived attempt budget as peek_input_until; prefer peek_input_until_verdict_with_options with an explicit budget for small protocol-sniffing buffers under TCP fragmentation.