Struct unrar::archive::Archive
[−]
[src]
pub struct Archive<'a> { /* fields omitted */ }
Methods
impl<'a> Archive<'a>
[src]
fn new(file: String) -> Self
Creates an Archive
object to operate on a plain RAR archive.
fn with_password(file: String, password: String) -> Self
Creates an Archive
object to operate on a password encrypted RAR archive.
fn set_comments(&mut self, comments: &'a mut Vec<u8>)
Set the comment buffer of the underlying archive. Note: Comments are not supported yet so this method will have no effect.
fn is_archive(&self) -> bool
Returns true
if the filename matches a RAR archive.
This method does not make any FS operations and operates purely on strings.
fn is_multipart(&self) -> bool
Returns true
if the filename matches a part of a multipart collection, false
otherwise
This method does not make any FS operations and operates purely on strings.
fn all_parts_option(&self) -> Option<Glob>
Returns a glob string covering all parts of the multipart collection or None
if the underlying archive is a single-part archive.
This method does not make any FS operations and operates purely on strings.
fn all_parts(&self) -> Glob
Returns a glob string covering all parts of the multipart collection or a copy of the underlying archive's filename if it's a single-part archive.
This method does not make any FS operations and operates purely on strings.
fn nth_part(&self, n: i32) -> Option<String>
Returns the nth part of this multi-part collection or None
if the underlying archive is single part
This method does not make any FS operations and operates purely on strings.
fn first_part_option(&self) -> Option<String>
Return the first part of the multipart collection or None
if the underlying archive is single part
This method does not make any FS operations and operates purely on strings.
fn first_part(&self) -> String
Returns the first part of the multipart collection or a copy of the underlying archive's filename if it's a single-part archive.
This method does not make any FS operations and operates purely on strings.
fn as_first_part(&mut self)
Changes the filename to point to the first part of the multipart collection. Does nothing if it is a single-part archive.
This method does not make any FS operations and operates purely on strings.
fn list(self) -> UnrarResult<OpenArchive>
Opens the underlying archive for listing its contents
fn list_split(self) -> UnrarResult<OpenArchive>
Opens the underlying archive for listing its contents without omitting or pooling split entries
fn extract_to(self, path: String) -> UnrarResult<OpenArchive>
Opens the underlying archive for extracting to the given directory.
fn test(self) -> UnrarResult<OpenArchive>
Opens the underlying archive for testing.
fn open(
self,
mode: OpenMode,
path: Option<String>,
operation: Operation
) -> UnrarResult<OpenArchive>
self,
mode: OpenMode,
path: Option<String>,
operation: Operation
) -> UnrarResult<OpenArchive>
Opens the underlying archive with the provided parameters.