Skip to main content

peek_input_until_with_offset

Function peek_input_until_with_offset 

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

Same as peek_input_until but with a starting offset as peek-size.

It is assumed that the offset is within the buffer boundaries, but it will be clamped to the buffer.len() regardless. The predicate is evaluated against the prefilled prefix before reading.

Uses the buffer-derived attempt budget; see peek_input_until_with_options when you need an explicit budget.