Expand description
Asar archive writer.
Implementations
sourceimpl<F: AsyncRead + Unpin> Writer<F>
impl<F: AsyncRead + Unpin> Writer<F>
sourcepub fn add(&mut self, path: &str, content: F, size: u64)
pub fn add(&mut self, path: &str, content: F, size: u64)
Add an entry to the archive.
The entry’s parent directories are created recursively if they do not exist.
size should correspond with content. If size is smaller, exactly
size bytes will be written. If size is bigger, the
Writer::write method will fail. For convenience, you may want
to use add_sized.
Panic
The method panics if normalised path contains no filename, or if the
path is already occupied by a previously inserted file.
sourcepub fn add_empty_folder(&mut self, path: &str)
pub fn add_empty_folder(&mut self, path: &str)
Adds an empty folder recursively to the archive.
sourceimpl<F: AsyncRead + AsyncSeek + Unpin> Writer<F>
impl<F: AsyncRead + AsyncSeek + Unpin> Writer<F>
sourcepub async fn add_sized(&mut self, path: &str, content: F) -> Result<()>
pub async fn add_sized(&mut self, path: &str, content: F) -> Result<()>
Add an entry to the archive.
Similar to Writer::add, but it uses AsyncSeekExt::seek to
determine the size of the content.
For more information see Writer::add.
pub async fn add_sized_with_integrity(
&mut self,
path: &str,
content: F
) -> Result<()>
Available on crate feature
integrity only.Trait Implementations
Auto Trait Implementations
impl<F> RefUnwindSafe for Writer<F> where
F: RefUnwindSafe,
impl<F> Send for Writer<F> where
F: Send,
impl<F> Sync for Writer<F> where
F: Sync,
impl<F> Unpin for Writer<F>
impl<F> UnwindSafe for Writer<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more