pub struct Archive<T: Read + Seek>(/* private fields */);Expand description
Wrapper unifying the API of all the different compression formats supported by langs. Unfortunately the API is more complicated due to tar only supporting iterating through the files one by one, while zip only supports accessing by index.
Implementations§
Source§impl<T: Read + Seek> Archive<T>
impl<T: Read + Seek> Archive<T>
pub fn new(archive: T, compression: Compression) -> Result<Self, TmcError>
pub fn tar(archive: T) -> Self
pub fn tar_zstd(archive: T) -> Result<Self, TmcError>
pub fn zip(archive: T) -> Result<Self, TmcError>
pub fn extract(self, target_directory: &Path) -> Result<(), TmcError>
pub fn iter(&mut self) -> Result<ArchiveIterator<'_, T>, TmcError>
pub fn by_path(&mut self, path: &str) -> Result<Entry<'_, T>, TmcError>
pub fn compression(&self) -> Compression
pub fn into_inner(self) -> T
Auto Trait Implementations§
impl<T> !Freeze for Archive<T>
impl<T> !RefUnwindSafe for Archive<T>
impl<T> Send for Archive<T>where
T: Send,
impl<T> !Sync for Archive<T>
impl<T> Unpin for Archive<T>where
T: Unpin,
impl<T> !UnwindSafe for Archive<T>
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