[][src]Struct rc_zip::ArchiveReader

pub struct ArchiveReader { /* fields omitted */ }

ArchiveReader parses a valid zip archive into an Archive. In particular, this struct finds an end of central directory record, parses the entire central directory, detects text encoding, and normalizes metadata.

Methods

impl ArchiveReader[src]

pub fn new(size: u64) -> Self[src]

Create a new archive reader with a specified file size.

Actual reading of the file is performed by calling wants_read(), read() and process() in a loop.

pub fn wants_read(&self) -> Option<u64>[src]

Returns whether or not this reader needs more data to continue.

Returns Some(offset) if this reader needs to read some data from offset. In this case, read() should be called with a Read at the correct offset.

Returns None if the reader does not need data and process() can be called directly.

pub fn read(&mut self, rd: &mut dyn Read) -> Result<usize, Error>[src]

Reads some data from rd into the reader's internal buffer.

Any I/O errors will be returned.

If successful, this returns the number of bytes read. On success, process() should be called next.

pub fn process(&mut self) -> Result<ArchiveReaderResult, Error>[src]

Process buffered data

Errors returned from process() are caused by invalid zip archives, unsupported format quirks, or implementation bugs - never I/O errors.

A result of ArchiveReaderResult::Continue indicates one should loop again, starting with wants_read().

A result of ArchiveReaderResult::Done contains the Archive, and indicates that no method should ever be called again on this reader.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = !

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.