pub struct Archive<B: Backend> { /* private fields */ }
Expand description
The archive.
Implementations§
Source§impl<B: Backend> Archive<B>
impl<B: Backend> Archive<B>
Sourcepub fn first(&mut self) -> Option<ArchiveResult<Entry<'_, B>, B>>
pub fn first(&mut self) -> Option<ArchiveResult<Entry<'_, B>, B>>
Returns the first entry in the archive.
Next, you can use Entry::next()
to traverse through the archive.
If the archive is empty, None
is returned.
Sourcepub fn append_file<N: AsRef<str>>(&mut self, name: N) -> FileBuilder<'_, B>
pub fn append_file<N: AsRef<str>>(&mut self, name: N) -> FileBuilder<'_, B>
Appends a new file entry with the given name
at the end of the
archive.
The method returns a FileBuilder
instance, where you are able to
set some more properties for the new entry. Calling
FileBuilder::build()
will finally create the entry.
Sourcepub fn append_directory<N: AsRef<str>>(
&mut self,
name: N,
) -> DirectoryBuilder<'_, B>
pub fn append_directory<N: AsRef<str>>( &mut self, name: N, ) -> DirectoryBuilder<'_, B>
Appends a new directory entry with the given name
at the end of the
archive.
The method returns a DirectoryBuilder
instance, where you are able
to set some more properties for the new entry. Calling
DirectoryBuilder::build()
will finally create the entry.
Sourcepub fn append_symlink<N: AsRef<str>, T: AsRef<str>>(
&mut self,
name: N,
target: T,
) -> SymlinkBuilder<'_, B>
pub fn append_symlink<N: AsRef<str>, T: AsRef<str>>( &mut self, name: N, target: T, ) -> SymlinkBuilder<'_, B>
Appends a new symlink entry with the given name
at the end of the
archive.
The symlink points to the given target
name.
The method returns a SymlinkBuilder
instance, where you are able to
set some more properties for the new entry. Calling
SymlinkBuilder::build()
will finally create the entry.
Sourcepub fn into_container(self) -> Container<B>
pub fn into_container(self) -> Container<B>
Consumes this Archive
, returning the underlying Container
.