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.
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.
Trait Implementations§
Source§impl<R: Clone> Clone for ZipFileReader<R>
impl<R: Clone> Clone for ZipFileReader<R>
Source§fn clone(&self) -> ZipFileReader<R>
fn clone(&self) -> ZipFileReader<R>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<R> Freeze for ZipFileReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for ZipFileReader<R>where
R: RefUnwindSafe,
impl<R> Send for ZipFileReader<R>where
R: Send,
impl<R> Sync for ZipFileReader<R>where
R: Sync,
impl<R> Unpin for ZipFileReader<R>where
R: Unpin,
impl<R> UnwindSafe for ZipFileReader<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