Unzip

Struct Unzip 

Source
pub struct Unzip {
    pub zip_pwd: Option<String>,
}

Fields§

§zip_pwd: Option<String>

Implementations§

Source§

impl Unzip

Source

pub fn new(zip_pwd: Option<String>) -> Self

Trait Implementations§

Source§

impl Zip for Unzip

Source§

fn extract<P>( &self, zip_input_path: P, zip_output_path: P, ) -> Result<bool, BridgeError>
where P: AsRef<Path>,

@description: Decompression extractor @parama zip_src_path: Decompression target path @parama zip_output_path: Output Path

Source§

fn file_compression<P>( &self, zip_input_path: P, zip_output_path: P, ) -> Result<bool, BridgeError>
where P: AsRef<Path>,

@description: Single file compression @parama zip_input_path: Compression target path @parama zip_output_path: Output Path

Source§

fn single_folder_compression<P: AsRef<Path>>( &self, zip_input_path: P, zip_output_path: P, ) -> Result<bool, BridgeError>

@description: Single folder compression @parama zip_input_path: Compression target path @parama zip_output_path: Output Path

Source§

fn batch_compression<P>( &self, zip_input_paths: Vec<P>, zip_output_path: P, ) -> Result<bool, BridgeError>
where P: AsRef<Path>,

batch compression Please provide a list path @parama zip_input_paths: [zip_input_path1, zip_input_path2, …] @parama zip_output_path: Output Path

Source§

fn add_dir<P: AsRef<Path>>( &self, zip_writer: &mut ZipWriter<File>, base_dir: P, current_dir: P, ) -> Result<bool, BridgeError>

@description: Add directory @parama zip_writer: ZipWriter @parama base_dir: Directory path @parama current_dir: Base directory

Source§

fn add_path<P: AsRef<Path>>( &self, zip_writer: &mut ZipWriter<File>, path: P, ) -> Result<bool, BridgeError>

@description: Add a path to the zip file @parama zip_writer: zip_writer @parama path: Path

Source§

fn check_folder_is_empty<P: AsRef<Path>>( &self, path: P, ) -> Result<bool, BridgeError>

@description Check whether the folder is empty @parama path: Path

Source§

fn calculate_size<P>(&self, path: P) -> Result<f64, BridgeError>
where P: AsRef<Path>,

Calculate file size
Source§

fn get_size<P>(&self, path: P) -> u64
where P: AsRef<Path>,

Read file size

Auto Trait Implementations§

§

impl Freeze for Unzip

§

impl RefUnwindSafe for Unzip

§

impl Send for Unzip

§

impl Sync for Unzip

§

impl Unpin for Unzip

§

impl UnwindSafe for Unzip

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 = 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V