pub struct ZipEntryReader<'a, R, E> { /* private fields */ }Expand description
A ZIP entry reader which may implement decompression.
Implementations§
Source§impl<'a, R, E> ZipEntryReader<'a, R, E>where
R: AsyncBufRead + Unpin,
impl<'a, R, E> ZipEntryReader<'a, R, E>where
R: AsyncBufRead + Unpin,
Sourcepub fn compute_hash(&mut self) -> u32
pub fn compute_hash(&mut self) -> u32
Computes and returns the CRC32 hash of bytes read by this reader so far.
This hash should only be computed once EOF has been reached.
Sourcepub fn bytes_read(&self) -> u64
pub fn bytes_read(&self) -> u64
Return the number of bytes read so far by this reader.
Source§impl<R> ZipEntryReader<'_, R, WithEntry<'_>>where
R: AsyncBufRead + Unpin,
impl<R> ZipEntryReader<'_, R, WithEntry<'_>>where
R: AsyncBufRead + Unpin,
Sourcepub async fn read_to_end_checked(&mut self, buf: &mut Vec<u8>) -> Result<usize>
pub async fn read_to_end_checked(&mut self, buf: &mut Vec<u8>) -> Result<usize>
Reads all bytes until EOF has been reached, appending them to buf, and verifies the CRC32 values.
This is a helper function synonymous to AsyncReadExt::read_to_end().
Sourcepub async fn read_to_string_checked(
&mut self,
buf: &mut String,
) -> Result<usize>
pub async fn read_to_string_checked( &mut self, buf: &mut String, ) -> Result<usize>
Reads all bytes until EOF has been reached, placing them into buf, and verifies the CRC32 values.
This is a helper function synonymous to AsyncReadExt::read_to_string().
Trait Implementations§
Source§impl<'a, R, E> AsyncRead for ZipEntryReader<'a, R, E>where
R: AsyncBufRead + Unpin,
impl<'a, R, E> AsyncRead for ZipEntryReader<'a, R, E>where
R: AsyncBufRead + Unpin,
impl<'pin, 'a, R, E> Unpin for ZipEntryReader<'a, R, E>where
PinnedFieldsOf<__ZipEntryReader<'pin, 'a, R, E>>: Unpin,
Auto Trait Implementations§
impl<'a, R, E> Freeze for ZipEntryReader<'a, R, E>
impl<'a, R, E> RefUnwindSafe for ZipEntryReader<'a, R, E>where
E: RefUnwindSafe,
R: RefUnwindSafe,
impl<'a, R, E> Send for ZipEntryReader<'a, R, E>
impl<'a, R, E> Sync for ZipEntryReader<'a, R, E>
impl<'a, R, E> !UnwindSafe for ZipEntryReader<'a, R, E>
Blanket Implementations§
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadFuture<'a, Self>where
Self: Unpin,
Reads some bytes from the byte stream. Read more
Source§fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
fn read_vectored<'a>(
&'a mut self,
bufs: &'a mut [IoSliceMut<'a>],
) -> ReadVectoredFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(
&'a mut self,
buf: &'a mut Vec<u8>,
) -> ReadToEndFuture<'a, Self>where
Self: Unpin,
Source§fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
buf: &'a mut String,
) -> ReadToStringFuture<'a, Self>where
Self: Unpin,
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExactFuture<'a, Self>where
Self: Unpin,
Reads the exact number of bytes required to fill
buf. Read moreSource§fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
fn take(self, limit: u64) -> Take<Self>where
Self: Sized,
Creates an adapter which will read at most
limit bytes from it. Read moreSource§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