Skip to main content

ZipStreamReader

Struct ZipStreamReader 

Source
pub struct ZipStreamReader<R>(/* private fields */);
Expand description

Stream decoder for zip.

Implementations§

Source§

impl<R> ZipStreamReader<R>

Source

pub const fn new(reader: R) -> Self

Create a new ZipStreamReader

Source§

impl<R: Read> ZipStreamReader<R>

Source

pub fn visit<V: ZipStreamVisitor>(self, visitor: &mut V) -> ZipResult<()>

Iterate over the stream and extract all file and their metadata.

Source

pub fn extract<P: AsRef<Path>>(self, directory: P) -> ZipResult<()>

Extract a Zip archive into a directory, overwriting files if they already exist. Paths are sanitized with ZipFile::enclosed_name.

Extraction is not atomic; If an error is encountered, some of the files may be left on disk. The file(s) and dir(s) are first created, then the permissions are applied to them

Extraction of symlink is not possible since we don’t have access to the external attributes in the local headers of the entries

Trait Implementations§

Source§

impl<R: Debug> Debug for ZipStreamReader<R>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<R> Freeze for ZipStreamReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for ZipStreamReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for ZipStreamReader<R>
where R: Send,

§

impl<R> Sync for ZipStreamReader<R>
where R: Sync,

§

impl<R> Unpin for ZipStreamReader<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for ZipStreamReader<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for ZipStreamReader<R>
where R: 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> 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, 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.