ZipFileReader

Struct ZipFileReader 

Source
pub struct ZipFileReader<S>(/* private fields */);
Expand description

A ZIP reader which acts over a non-seekable source.

See the module-level docs for more information.

Implementations§

Source§

impl<'a, R> ZipFileReader<Ready<Counting<R>>>
where R: AsyncBufRead + Unpin + 'a,

Source

pub fn new(reader: R) -> Self

Constructs a new ZIP reader from a non-seekable source.

Source

pub async fn next_without_entry( self, ) -> Result<Option<ZipFileReader<Reading<'a, Counting<R>, WithoutEntry>>>>

Opens the next entry for reading if the central directory hasn’t yet been reached.

Source

pub async fn next_with_entry( self, ) -> Result<Option<ZipFileReader<Reading<'a, Counting<R>, WithEntry<'a>>>>>

Opens the next entry for reading if the central directory hasn’t yet been reached.

Source

pub async fn into_inner(self) -> R

Consumes the ZipFileReader returning the original reader

Source

pub fn offset(&self) -> u64

Returns the file offset of the current reader.

Source§

impl<R> ZipFileReader<Ready<R>>
where R: AsyncBufRead + Unpin,

Source

pub fn with_tokio(reader: R) -> ZipFileReader<TokioReady<R>>

Available on crate feature tokio only.

Constructs a new tokio-specific ZIP reader from a non-seekable source.

Source§

impl<'a, R, E> ZipFileReader<Reading<'a, R, E>>
where R: AsyncBufRead + Unpin,

Source

pub fn reader(&self) -> &ZipEntryReader<'a, R, E>

Returns an immutable reference to the inner entry reader.

Source

pub fn reader_mut(&mut self) -> &mut ZipEntryReader<'a, R, E>

Returns a mutable reference to the inner entry reader.

Source

pub async fn done( self, ) -> Result<(Option<CombinedDataDescriptor>, ZipFileReader<Ready<R>>)>

Converts the reader back into the Ready state if EOF has been reached.

Source

pub async fn skip( self, ) -> Result<(Option<CombinedDataDescriptor>, ZipFileReader<Ready<R>>)>

Reads until EOF and converts the reader back into the Ready state.

Trait Implementations§

Source§

impl<S: Clone> Clone for ZipFileReader<S>

Source§

fn clone(&self) -> ZipFileReader<S>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<S> Freeze for ZipFileReader<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for ZipFileReader<S>
where S: RefUnwindSafe,

§

impl<S> Send for ZipFileReader<S>
where S: Send,

§

impl<S> Sync for ZipFileReader<S>
where S: Sync,

§

impl<S> Unpin for ZipFileReader<S>
where S: Unpin,

§

impl<S> UnwindSafe for ZipFileReader<S>
where S: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.