pub struct ArchiveReader<R: AsyncRead + AsyncSeek + Unpin> { /* private fields */ }Expand description
Reads a 7z archive file.
Implementations§
Source§impl ArchiveReader<Cursor<Vec<u8>>>
impl ArchiveReader<Cursor<Vec<u8>>>
Source§impl<R: AsyncRead + AsyncSeek + Unpin + Send> ArchiveReader<R>
impl<R: AsyncRead + AsyncSeek + Unpin + Send> ArchiveReader<R>
Sourcepub fn from_archive(archive: Archive, source: R, password: Password) -> Self
pub fn from_archive(archive: Archive, source: R, password: Password) -> Self
Creates an ArchiveReader from an existing Archive instance.
This is useful when you already have a parsed archive and want to create a reader without re-parsing the archive structure.
§Arguments
archive- An existing parsed archive instancesource- The reader providing access to the archive datapassword- Password for encrypted archives
Sourcepub fn set_thread_count(&mut self, thread_count: u32)
pub fn set_thread_count(&mut self, thread_count: u32)
Sets the thread count to use when multi-threading is supported by the de-compression (currently only LZMA2 if encoded with MT support).
Defaults to std::thread::available_parallelism() if not set manually.
Sourcepub fn archive(&self) -> &Archive
pub fn archive(&self) -> &Archive
Returns a reference to the underlying Archive structure.
This provides access to the archive metadata including files, blocks, and compression information.
Sourcepub async fn read_file(&mut self, name: &str) -> Result<Vec<u8>, Error>
pub async fn read_file(&mut self, name: &str) -> Result<Vec<u8>, Error>
Returns the data of a file with the given path inside the archive.
§Notice
This function is very inefficient when used with solid archives, since it needs to decode all data before the actual file.
Sourcepub fn file_compression_methods(
&self,
file_name: &str,
methods: &mut Vec<EncoderMethod>,
) -> Result<(), Error>
pub fn file_compression_methods( &self, file_name: &str, methods: &mut Vec<EncoderMethod>, ) -> Result<(), Error>
Get the compression method(s) used for a specific file in the archive.