[−][src]Function mla::helpers::linear_extract
pub fn linear_extract<W1: Write, R: Read + Seek, S: BuildHasher>(
archive: &mut ArchiveReader<'_, R>,
export: &mut HashMap<&String, W1, S>
) -> Result<(), Error>
Extract an Archive linearly.
export
maps filenames to Write objects, which will receives the
corresponding file's content. If a file is in the archive but not in
export
, this file will be silently ignored.
This is an effective way to extract all elements from an MLA Archive. It
avoids seeking for each files, and for each files parts if files are
interleaved. For an MLA Archive, seeking could be a costly operation, and might
involve reading data to Sink
(seeking in decompression), or involves
additional computation (getting a whole encrypted block to check its
encryption tag).
Linear extraction avoids these costs by reading once and only once each byte,
and by reducing the amount of seeks.