pub struct Unroll<R> { /* private fields */ }Expand description
Archive unroller
NOTE: Currently supported .tar.gz archives only.
Implementations§
Source§impl<R> Unroll<R>
impl<R> Unroll<R>
Sourcepub const fn create_dest_path(self, flag: bool) -> Self
pub const fn create_dest_path(self, flag: bool) -> Self
Create destination directory when it doesn’t exists
Default: true
Sourcepub const fn cleanup_dest_dir(self, flag: bool) -> Self
pub const fn cleanup_dest_dir(self, flag: bool) -> Self
Cleanup destination directory before extraction
Default: true
Sourcepub const fn fix_invalid_dest(self, flag: bool) -> Self
pub const fn fix_invalid_dest(self, flag: bool) -> Self
Try to fix destination path when it is not a valid
For example, when destination already exists and it is not a directory, it will be removed
Default: true
Sourcepub const fn cleanup_on_error(self, flag: bool) -> Self
pub const fn cleanup_on_error(self, flag: bool) -> Self
Cleanup already extracted data when errors occurs
Default: true
Sourcepub const fn strip_components(self, num_of_components: usize) -> Self
pub const fn strip_components(self, num_of_components: usize) -> Self
Strip the number of leading components from file names on extraction
Default: 0
Sourcepub const fn strip_when_alone(self, flag: bool) -> Self
pub const fn strip_when_alone(self, flag: bool) -> Self
Strip the leading components only when it’s alone
Default: false
Source§impl<R> Unroll<R>
impl<R> Unroll<R>
Sourcepub fn to<D>(self, path: D) -> Status
pub fn to<D>(self, path: D) -> Status
Extract contents to specified directory
§Errors
- Destination directory does not exists when
create_dest_pathis not set - Destination directory is not empty when
cleanup_dest_diris not set - Destination path is not a directory when
fix_invalid_destis not set - Required number of path components cannot be stripped when
strip_when_aloneis not set
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Unroll<R>where
R: Freeze,
impl<R> !RefUnwindSafe for Unroll<R>
impl<R> Send for Unroll<R>where
R: Send,
impl<R> Sync for Unroll<R>where
R: Sync,
impl<R> Unpin for Unroll<R>where
R: Unpin,
impl<R> !UnwindSafe for Unroll<R>
Blanket Implementations§
Source§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