Struct SevenZReader

Source
pub struct SevenZReader<R: Read + Seek> { /* private fields */ }
Expand description

Reads a 7z file.

Implementations§

Source§

impl SevenZReader<File>

Source

pub fn open(path: impl AsRef<Path>, password: Password) -> Result<Self, Error>

Opens a 7z archive file at the given path and creates a SevenZReader to read it.

Source§

impl<R: Read + Seek> SevenZReader<R>

Source

pub fn new(source: R, password: Password) -> Result<Self, Error>

Creates a SevenZReader to read a 7z archive file from the given source reader.

Source

pub fn from_archive(archive: Archive, source: R, password: Password) -> Self

Source

pub fn archive(&self) -> &Archive

Source

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.

Source

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.

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.