[−][src]Struct rc_zip::ArchiveReader
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
impl RefUnwindSafe for ArchiveReader
impl Send for ArchiveReader
impl Sync for ArchiveReader
impl Unpin for ArchiveReader
impl UnwindSafe for ArchiveReader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,