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 calculate_size(&self, path: &str) -> Result<f64, BridgeError>

Calculate file size

Source§

fn get_size(&self, path: &str) -> u64

Read file size

Source§

fn extract( &self, input_path: &str, output_dir: &str, ) -> Result<bool, BridgeError>

extract

Source§

fn compress_file( &self, input_path: &str, out_path: &str, ) -> Result<bool, BridgeError>

Pay special attention to compressing files in zip format, as it is a single file, not a folder

Source§

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

Recursive compression folder

Source§

fn compress_multiple( &self, input_paths: Vec<&str>, out_path: &str, ) -> Result<bool, BridgeError>

Compress multiple files

Source§

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

Determine if the directory is empty

Source§

fn add_path_to_zip<P: AsRef<Path>>( &self, zip_writer: &mut ZipWriter<&mut Cursor<Vec<u8>>>, path: P, ) -> Result<bool, BridgeError>

Add path to zip file

Source§

fn compress_folder<P: AsRef<Path>>( &self, input_paths: P, out_file: P, ) -> Result<bool, BridgeError>

Compressed Folder
Source§

fn add_absolute_dir_to_zip<P: AsRef<Path>>( &self, zip_writer: &mut ZipWriter<&mut Cursor<Vec<u8>>>, path: P, prefix: &Path, ) -> Result<bool, BridgeError>

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