pub struct SevenZReader<R: Read + Seek> { /* private fields */ }Expand description
Reads a 7z file.
Implementations§
Source§impl SevenZReader<File>
impl SevenZReader<File>
Source§impl<R: Read + Seek> SevenZReader<R>
impl<R: Read + Seek> SevenZReader<R>
Sourcepub fn new(source: R, password: Password) -> Result<Self, Error>
pub fn new(source: R, password: Password) -> Result<Self, Error>
Creates a SevenZReader to read a 7z archive file from the given source reader.
pub fn from_archive(archive: Archive, source: R, password: Password) -> Self
pub fn archive(&self) -> &Archive
Sourcepub fn for_each_entries<F: FnMut(&SevenZArchiveEntry, &mut dyn Read) -> Result<bool, Error>>(
&mut self,
each: F,
) -> Result<(), Error>
pub fn for_each_entries<F: FnMut(&SevenZArchiveEntry, &mut dyn Read) -> Result<bool, Error>>( &mut self, each: F, ) -> Result<(), Error>
Takes a closure to decode each files in the archive.
Attention about solid archive: When decoding a solid archive, the data to be decompressed depends on the data in front of it, you cannot simply skip the previous data and only decompress the data in the back.
Sourcepub fn read_file(&mut self, name: &str) -> Result<Vec<u8>, Error>
pub 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<SevenZMethod>,
) -> Result<(), Error>
pub fn file_compression_methods( &self, file_name: &str, methods: &mut Vec<SevenZMethod>, ) -> Result<(), Error>
Get the compression method(s) used for a specific file in the archive.
Auto Trait Implementations§
impl<R> Freeze for SevenZReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for SevenZReader<R>where
R: RefUnwindSafe,
impl<R> Send for SevenZReader<R>where
R: Send,
impl<R> Sync for SevenZReader<R>where
R: Sync,
impl<R> Unpin for SevenZReader<R>where
R: Unpin,
impl<R> UnwindSafe for SevenZReader<R>where
R: UnwindSafe,
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