pub struct ZipFileReader<R> { /* private fields */ }Expand description
A ZIP reader which acts over a seekable source.
Implementations§
Source§impl<R> ZipFileReader<R>
impl<R> ZipFileReader<R>
Sourcepub async fn new(reader: R) -> Result<ZipFileReader<R>>
pub async fn new(reader: R) -> Result<ZipFileReader<R>>
Constructs a new ZIP reader from a seekable source.
The source must be finite or bounded to a single archive. At most 4 KiB of NUL padding is
permitted after the end record’s declared comment. Local headers are not walked during construction.
Archive and entry comments containing bytes 0x01 through 0x08 are conservatively rejected to
exclude embedded ZIP records; this does not prohibit ZIP files stored as entries.
Sourcepub fn from_raw_parts(reader: R, file: ZipFile) -> ZipFileReader<R>
pub fn from_raw_parts(reader: R, file: ZipFile) -> ZipFileReader<R>
Constructs a ZIP reader from a seekable source and ZIP file information derived from that source.
Providing a ZipFile that wasn’t derived from that source may lead to inaccurate parsing.
Sourcepub fn inner_mut(&mut self) -> &mut R
pub fn inner_mut(&mut self) -> &mut R
Returns a mutable reference to the inner seekable source.
Swapping the source (eg. via std::mem operations) may lead to inaccurate parsing.
Sourcepub fn into_inner(self) -> R
pub fn into_inner(self) -> R
Returns the inner seekable source by consuming self.
Sourcepub async fn reader_without_entry(
&mut self,
index: usize,
) -> Result<ZipEntryReader<'_, R, WithoutEntry>>
pub async fn reader_without_entry( &mut self, index: usize, ) -> Result<ZipEntryReader<'_, R, WithoutEntry>>
Returns a new entry reader if the provided index is valid.
Sourcepub async fn reader_with_entry(
&mut self,
index: usize,
) -> Result<ZipEntryReader<'_, R, WithEntry<'_>>>
pub async fn reader_with_entry( &mut self, index: usize, ) -> Result<ZipEntryReader<'_, R, WithEntry<'_>>>
Returns a new entry reader if the provided index is valid.
Sourcepub async fn into_entry<'a>(
self,
index: usize,
) -> Result<ZipEntryReader<'a, R, WithoutEntry>>where
R: 'a,
pub async fn into_entry<'a>(
self,
index: usize,
) -> Result<ZipEntryReader<'a, R, WithoutEntry>>where
R: 'a,
Returns a new entry reader if the provided index is valid. Consumes self
Source§impl<R> ZipFileReader<Compat<R>>
impl<R> ZipFileReader<Compat<R>>
Sourcepub async fn with_tokio(reader: R) -> Result<TokioZipFileReader<R>>
Available on crate feature tokio only.
pub async fn with_tokio(reader: R) -> Result<TokioZipFileReader<R>>
tokio only.Constructs a new tokio-specific ZIP reader from a seekable source.