Skip to main content

drive_from_slice

Function drive_from_slice 

Source
pub fn drive_from_slice<D>(
    decoder: &mut D,
    bytes: &[u8],
    sink: &mut dyn DecodeRowSink,
    pulse: Option<&dyn Pulse>,
    window: usize,
) -> Result<(OutputInfo, DriveStats), DriveError<D::Error, Infallible>>
Expand description

Run decoder over an in-memory image without copying it.

Every input is a sub-slice of bytes carrying the total length. A sequential request gets at least its minimum and up to window bytes (a small window exercises boundaries); a range gets exactly its span.

pulse is checked for cancellation each step (a plain Stop passes as how_far::StopOnly::borrowed(&stop)), told the row total once the header is known, and advanced by every strip written.