pub struct Extractor<'a> { /* private fields */ }
Implementations§
source§impl<'a> Extractor<'a>
impl<'a> Extractor<'a>
sourcepub fn new(input: &'a str, output: &'a str) -> Extractor<'a>
pub fn new(input: &'a str, output: &'a str) -> Extractor<'a>
Create a new extractor with the given input and output
Example
use comprexor::Extractor;
let extractor = Extractor::new("./compacted-archive.tar.gz", "./output-folder-or-file");
extractor.extract().unwrap();
sourcepub fn extract(&self) -> Result<ArchiveInfo, Error>
pub fn extract(&self) -> Result<ArchiveInfo, Error>
Decompress the input file to the output file
Example
use comprexor::Extractor;
let extractor = Extractor::new("./compacted-archive.tar.gz", "./output-folder-or-file");
extractor.extract().unwrap();
Errors
This function will return an error if the input file is not a valid gzip file or something goes wrong while decompressing
Trait Implementations§
source§impl<'a> PartialEq<Extractor<'a>> for Extractor<'a>
impl<'a> PartialEq<Extractor<'a>> for Extractor<'a>
source§impl<'a> PartialOrd<Extractor<'a>> for Extractor<'a>
impl<'a> PartialOrd<Extractor<'a>> for Extractor<'a>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'a> StructuralPartialEq for Extractor<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Extractor<'a>
impl<'a> Send for Extractor<'a>
impl<'a> Sync for Extractor<'a>
impl<'a> Unpin for Extractor<'a>
impl<'a> UnwindSafe for Extractor<'a>
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