copy_until

Function copy_until 

Source
pub fn copy_until<R>(
    reader: &mut R,
    val: &[u8],
    deadline: Instant,
) -> Result<[Vec<u8>; 2], Error>
where R: Read + ?Sized,
Expand description

Reads data from reader and checks for specified value. When data contains specified value or deadline is reached, stops reading. Returns read data as array of two vectors: elements before and after the val.