pub struct Archive<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Archive<'a>
impl<'a> Archive<'a>
Sourcepub fn new<F>(file: &'a F) -> Result<Self, Error>
pub fn new<F>(file: &'a F) -> Result<Self, Error>
Creates an Archive
object to operate on a plain RAR archive
Sourcepub fn with_password<F, P>(file: &'a F, password: &'a P) -> Result<Self, Error>
pub fn with_password<F, P>(file: &'a F, password: &'a P) -> Result<Self, Error>
Creates an Archive
object to operate on a password-encrypted RAR archive.
Sourcepub fn set_comments(&mut self, comments: &'a mut [u8])
pub fn set_comments(&mut self, comments: &'a mut [u8])
Set the comment buffer of the underlying archive. Note: Comments are not yet implemented; this function will have no effect at this time.
Sourcepub fn is_archive(&self) -> bool
pub fn is_archive(&self) -> bool
Returns true
if the filename matches a RAR archive; false
otherwise.
This method does not perform any filesystem operations; it operates purely on the string filename.
Sourcepub fn is_multipart(&self) -> bool
pub fn is_multipart(&self) -> bool
Returns true
if the filename matches a part of a multipart collection; false
otherwise.
This method does not perform any filesystem operations; it operates purely on the string filename.
Sourcepub fn try_all_parts(&self) -> Option<PathBuf>
pub fn try_all_parts(&self) -> Option<PathBuf>
Returns a glob string covering all parts of the multipart collection, or None
if the archive is single-part.
This method does not make any filesystem operations; it operates purely on the string filename.
Sourcepub fn all_parts(&self) -> PathBuf
pub fn all_parts(&self) -> PathBuf
Returns a glob string covering all parts of the multipart collection, or a copy of the archive’s entire filename if it’s a single-part archive.
This method does not make any filesystem operations; it operates purely on the string filename.
Sourcepub fn nth_part(&self, n: usize) -> Option<PathBuf>
pub fn nth_part(&self, n: usize) -> Option<PathBuf>
Returns the nth part of this multi-part collection, or None
if the archive is single-part.
This method does not make any filesystem operations; it operates purely on the string filename.
Sourcepub fn first_part(&self) -> PathBuf
pub fn first_part(&self) -> PathBuf
Returns the first part of the multi-part collection, or a copy of the underlying archive’s filename if the archive is single-part.
This method does not make any filesystem operations; it operates purely on the string filename.
Sourcepub fn as_first_part(&mut self)
pub fn as_first_part(&mut self)
Changes the filename to point to the first part of the multipart collection. Does nothing if the archive is single-part.
This method does not make any filesystem operations; it operates purely on the string filename.
Sourcepub async fn list(self) -> Result<OpenArchive, Error>
pub async fn list(self) -> Result<OpenArchive, Error>
Opens the underlying archive for listing its contents
Sourcepub async fn list_split(self) -> Result<OpenArchive, Error>
pub async fn list_split(self) -> Result<OpenArchive, Error>
Opens the underlying archive for listing its contents without omitting or pooling split entries
Sourcepub async fn extract_to(
self,
path: impl AsRef<Path>,
) -> Result<OpenArchive, Error>
pub async fn extract_to( self, path: impl AsRef<Path>, ) -> Result<OpenArchive, Error>
Opens the underlying archive for extracting to the given directory
Sourcepub async fn test(self) -> Result<OpenArchive, Error>
pub async fn test(self) -> Result<OpenArchive, Error>
Opens the underlying archive for testing