pub struct Writer { /* private fields */ }Expand description
Structure to write multiple files and corresponding metadata into a wpress archive.
Implementations§
Source§impl Writer
impl Writer
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Writer, ArchiveError>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Writer, ArchiveError>
Creates a new Writer with the destination being the path supplied.
Sourcepub fn add<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ArchiveError>
pub fn add<P: AsRef<Path>>(&mut self, path: P) -> Result<(), ArchiveError>
Lazily adds paths to the Writer. It merely tells the Writer to note the supplied path
and does not write to the underlying file. To write to the underlying file, use the
write method after adding all the files.
Sourcepub fn write(self) -> Result<(), ArchiveError>
pub fn write(self) -> Result<(), ArchiveError>
Writes header structures and associated data to the underlying file handle. Since the object is consumed, the file is closed on drop, making sure we cannot incorrectly write multiple times to the same file.
pub fn files_count(&self) -> usize
Auto Trait Implementations§
impl Freeze for Writer
impl RefUnwindSafe for Writer
impl Send for Writer
impl Sync for Writer
impl Unpin for Writer
impl UnwindSafe for Writer
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