Skip to main content

peek_input_until_with_offset

Function peek_input_until_with_offset 

pub async fn peek_input_until_with_offset<R, O, P>(
    reader: &mut R,
    buffer: &mut [u8],
    offset: usize,
    timeout: Option<Duration>,
    predicate: P,
) -> PeekOutput<O>
where R: AsyncRead + Unpin, P: Fn(&[u8]) -> Option<O>,
Expand description

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

It is assumed that the offst is within the buffer boundaries, but it will be clamped to the buffer.len() regardless.