pub struct ParallelFolderExtractor<'a> { /* private fields */ }Expand description
Parallel folder extractor for non-solid archives.
This extractor distributes folder decompression across multiple threads, providing significant speedup for archives with many independently-compressed files.
§Design
The extractor uses a two-phase approach:
- Preparation phase: Sequentially read all compressed data from the source
- Extraction phase: Decompress and write files in parallel
This design separates I/O from computation for better performance and avoids the complexity of sharing a reader across threads.
Implementations§
Source§impl<'a> ParallelFolderExtractor<'a>
impl<'a> ParallelFolderExtractor<'a>
Sourcepub fn new(
header: &'a ArchiveHeader,
entries: &'a [Entry],
options: ParallelExtractionOptions,
) -> Self
pub fn new( header: &'a ArchiveHeader, entries: &'a [Entry], options: ParallelExtractionOptions, ) -> Self
Creates a new parallel folder extractor.
Sourcepub fn can_extract_parallel(&self) -> bool
pub fn can_extract_parallel(&self) -> bool
Checks if the archive is suitable for parallel extraction.
Returns false for solid archives where files share compression blocks.
Sourcepub fn extract_to_directory<R: Read + Seek>(
&self,
source: &mut R,
dest: impl AsRef<Path>,
) -> Result<ParallelExtractionResult>
Available on crate feature parallel only.
pub fn extract_to_directory<R: Read + Seek>( &self, source: &mut R, dest: impl AsRef<Path>, ) -> Result<ParallelExtractionResult>
parallel only.Extracts all entries to a directory using parallel decompression.
§Arguments
source- The archive reader (used for sequential I/O in preparation phase)dest- Destination directory
Auto Trait Implementations§
impl<'a> Freeze for ParallelFolderExtractor<'a>
impl<'a> RefUnwindSafe for ParallelFolderExtractor<'a>
impl<'a> Send for ParallelFolderExtractor<'a>
impl<'a> Sync for ParallelFolderExtractor<'a>
impl<'a> Unpin for ParallelFolderExtractor<'a>
impl<'a> UnwindSafe for ParallelFolderExtractor<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more