[][src]Struct fetch_unroll::Unroll

pub struct Unroll<R> { /* fields omitted */ }

Archive unroller

NOTE: Currently supported .tar.gz archives only.

Implementations

impl<R> Unroll<R>[src]

pub const fn create_dest_path(self, flag: bool) -> Self[src]

Create destination directory when it doesn't exists

Default: true

pub const fn cleanup_dest_dir(self, flag: bool) -> Self[src]

Cleanup destination directory before extraction

Default: true

pub const fn fix_invalid_dest(self, flag: bool) -> Self[src]

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

pub const fn cleanup_on_error(self, flag: bool) -> Self[src]

Cleanup already extracted data when errors occurs

Default: true

pub const fn strip_components(self, num_of_components: usize) -> Self[src]

Strip the number of leading components from file names on extraction

Default: 0

pub const fn strip_when_alone(self, flag: bool) -> Self[src]

Strip the leading components only when it's alone

Default: false

impl<R> Unroll<R>[src]

pub fn to<D>(self, path: D) -> Status where
    R: Read,
    D: AsRef<Path>, 
[src]

Extract contents to specified directory

Errors

  • Destination directory does not exists when create_dest_path is not set
  • Destination directory is not empty when cleanup_dest_dir is not set
  • Destination path is not a directory when fix_invalid_dest is not set
  • Required number of path components cannot be stripped when strip_when_alone is not set

Trait Implementations

impl<R> From<Result<R, Error>> for Unroll<R>[src]

Auto Trait Implementations

impl<R> !RefUnwindSafe for Unroll<R>[src]

impl<R> Send for Unroll<R> where
    R: Send
[src]

impl<R> Sync for Unroll<R> where
    R: Sync
[src]

impl<R> Unpin for Unroll<R> where
    R: Unpin
[src]

impl<R> !UnwindSafe for Unroll<R>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.