Skip to main content

ZipArchive

Struct ZipArchive 

Source
pub struct ZipArchive<'a> {
    pub parent_dir: &'a Path,
    pub alt_parent_dir: Option<&'a Path>,
    pub files: &'a [PathBuf],
    pub output_path: &'a Path,
}

Fields§

§parent_dir: &'a Path

The parent directory of the files to be archived. This is used to create the directory structure in the archive.

§alt_parent_dir: Option<&'a Path>

Alternative parent directory to be used in the archive. This is used to create the directory structure if the parent directory is not present.

§files: &'a [PathBuf]

The files to be archived.

§output_path: &'a Path

The path to the output file.

Implementations§

Source§

impl<'a> ZipArchive<'a>

A zip archive writer. Writes the files to a zip archive. The files are written to the archive with the directory structure relative to the parent directory. If the parent directory is not present, the alternative parent directory is used to create the directory structure.

Source

pub fn new( parent_dir: &'a Path, alt_parent_dir: Option<&'a Path>, output_path: &'a Path, files: &'a [PathBuf], ) -> Self

Source

pub fn write(&self) -> Result<(), Error>

Auto Trait Implementations§

§

impl<'a> Freeze for ZipArchive<'a>

§

impl<'a> RefUnwindSafe for ZipArchive<'a>

§

impl<'a> Send for ZipArchive<'a>

§

impl<'a> Sync for ZipArchive<'a>

§

impl<'a> Unpin for ZipArchive<'a>

§

impl<'a> UnsafeUnpin for ZipArchive<'a>

§

impl<'a> UnwindSafe for ZipArchive<'a>

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.