pub struct ParseOptions {
pub filter: Option<Box<dyn Fn(&str, usize) -> bool + Send + Sync>>,
pub max_files: Option<usize>,
pub password: Option<String>,
}Expand description
Options for parsing RAR archives.
Use this struct to customize parsing behavior, including filtering, limiting results, and providing passwords for encrypted archives.
§Example
ⓘ
let opts = ParseOptions {
filter: Some(Box::new(|name, _| name.ends_with(".mp4"))),
max_files: Some(100),
#[cfg(feature = "crypto")]
password: Some("secret".to_string()),
};Fields§
§filter: Option<Box<dyn Fn(&str, usize) -> bool + Send + Sync>>Filter function: return true to include a file.
The function receives the file name and its index (0-based).
Only files where the filter returns true are included in results.
max_files: Option<usize>Maximum number of files to return.
Parsing stops after this many files are found. Useful for previewing large archives without parsing everything.
password: Option<String>Password for encrypted archives.
Required for archives with encrypted file data or headers.
If the password is wrong, RarError::DecryptionFailed is returned.
Trait Implementations§
Source§impl Default for ParseOptions
impl Default for ParseOptions
Source§fn default() -> ParseOptions
fn default() -> ParseOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParseOptions
impl !RefUnwindSafe for ParseOptions
impl Send for ParseOptions
impl Sync for ParseOptions
impl Unpin for ParseOptions
impl !UnwindSafe for ParseOptions
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