pub struct ZipFile<'a> { /* private fields */ }
Expand description
A struct for reading a zip file
Implementations
sourceimpl<'a> ZipFile<'a>
impl<'a> ZipFile<'a>
Methods for retrieving information on zip files
sourcepub fn version_made_by(&self) -> (u8, u8)
pub fn version_made_by(&self) -> (u8, u8)
Get the version of the file
sourcepub fn name_raw(&self) -> &[u8] ⓘ
pub fn name_raw(&self) -> &[u8] ⓘ
Get the name of the file, in the raw (internal) byte representation.
sourcepub fn sanitized_name(&self) -> PathBuf
pub fn sanitized_name(&self) -> PathBuf
Get the name of the file in a sanitized form. It truncates the name to the first NULL byte, removes a leading ‘/’ and removes ‘..’ parts.
sourcepub fn compression(&self) -> CompressionMethod
pub fn compression(&self) -> CompressionMethod
Get the compression method used to store the file
sourcepub fn compressed_size(&self) -> u64
pub fn compressed_size(&self) -> u64
Get the size of the file in the archive
sourcepub fn last_modified(&self) -> DateTime
pub fn last_modified(&self) -> DateTime
Get the time the file was last modified
sourcepub fn data_start(&self) -> u64
pub fn data_start(&self) -> u64
Get the starting offset of the data of the compressed file
Trait Implementations
sourceimpl<'a> Read for ZipFile<'a>
impl<'a> Read for ZipFile<'a>
sourcefn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Pull some bytes from this source into the specified buffer, returning
how many bytes were read. Read more
1.36.0 · sourcefn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
Like
read
, except that it reads into a slice of buffers. Read moresourcefn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · sourcefn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
Read all bytes until EOF in this source, placing them into
buf
. Read more1.0.0 · sourcefn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
Read all bytes until EOF in this source, appending them to
buf
. Read more1.6.0 · sourcefn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
Read the exact number of bytes required to fill
buf
. Read moresourcefn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
read_buf
)Pull some bytes from this source into the specified buffer. Read more
sourcefn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
read_buf
)Read the exact number of bytes required to fill
cursor
. Read more1.0.0 · sourcefn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Creates a “by reference” adaptor for this instance of
Read
. Read moreAuto Trait Implementations
impl<'a> !RefUnwindSafe for ZipFile<'a>
impl<'a> !Send for ZipFile<'a>
impl<'a> !Sync for ZipFile<'a>
impl<'a> Unpin for ZipFile<'a>
impl<'a> !UnwindSafe for ZipFile<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more