pub struct ArchiveWriter<W: Write> { /* private fields */ }Expand description
A writer for creating compressed archives.
ArchiveWriter allows creating archives in any destination that implements Write.
It supports various formats (TAR, ZIP, 7ZIP, etc.) and compression filters (GZIP, BZIP2, XZ, etc.).
Implementations§
Source§impl<W: Write> ArchiveWriter<W>
impl<W: Write> ArchiveWriter<W>
Sourcepub fn new(dest: W) -> Result<ArchiveWriter<W>, Error>where
W: Write,
pub fn new(dest: W) -> Result<ArchiveWriter<W>, Error>where
W: Write,
Creates a new ArchiveWriter that writes to the given destination.
Sourcepub fn set_output_format(&mut self, format: c_int) -> Result<(), Error>
pub fn set_output_format(&mut self, format: c_int) -> Result<(), Error>
Sets the output format for the archive (e.g., TAR, ZIP).
Sourcepub fn set_output_filter(&mut self, filter: c_int) -> Result<(), Error>
pub fn set_output_filter(&mut self, filter: c_int) -> Result<(), Error>
Sets the output filter (compression) for the archive (e.g., GZIP, BZIP2).
pub fn add_filter_option( &mut self, name: &str, value: &str, ) -> Result<(), Error>
pub fn add_format_option( &mut self, name: &str, value: &str, ) -> Result<(), Error>
Sourcepub fn open(&mut self) -> Result<(), Error>
pub fn open(&mut self) -> Result<(), Error>
Opens the archive for writing. This must be called after setting the format and filter, but before adding files.
pub fn set_compression_high(&mut self) -> Result<(), Error>
pub fn set_compression_mid(&mut self) -> Result<(), Error>
pub fn set_compression_low(&mut self) -> Result<(), Error>
pub fn set_output_targz(&mut self) -> Result<(), Error>
pub fn set_output_tarxz(&mut self) -> Result<(), Error>
pub fn set_output_tarzst(&mut self) -> Result<(), Error>
pub fn set_output_7zlzma2(&mut self) -> Result<(), Error>
pub fn set_output_zip(&mut self) -> Result<(), Error>
pub fn add_obj_from_reader<S: Read>( &mut self, source: S, archivepath: &str, objmeta: &Metadata, ) -> Result<(), Error>
Trait Implementations§
Source§impl<W: Write> Drop for ArchiveWriter<W>
impl<W: Write> Drop for ArchiveWriter<W>
Auto Trait Implementations§
impl<W> !Send for ArchiveWriter<W>
impl<W> !Sync for ArchiveWriter<W>
impl<W> Freeze for ArchiveWriter<W>
impl<W> RefUnwindSafe for ArchiveWriter<W>where
W: RefUnwindSafe,
impl<W> Unpin for ArchiveWriter<W>
impl<W> UnsafeUnpin for ArchiveWriter<W>
impl<W> UnwindSafe for ArchiveWriter<W>where
W: UnwindSafe,
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