#![cfg_attr(feature = "fast", feature(portable_simd))]
pub mod detect;
pub mod error;
pub mod features;
pub mod rar13;
pub mod rar15_40;
pub mod rar50;
pub mod version;
mod fast;
mod io_util;
#[cfg(feature = "parallel")]
mod parallel;
mod source;
mod volume_extract;
mod x86_filter_scan;
pub use detect::{detect_archive_family, find_archive_start, ArchiveSignature, SFX_SCAN_LIMIT};
pub use error::{Error, Result};
pub use features::FeatureSet;
pub use version::{ArchiveFamily, ArchiveVersion};
#[derive(Debug, Clone, Copy, Default)]
#[non_exhaustive]
pub struct ArchiveReadOptions<'a> {
pub password: Option<&'a [u8]>,
pub rar50_buffered_decode_limit: Option<u64>,
}
impl<'a> ArchiveReadOptions<'a> {
pub fn new() -> Self {
Self::default()
}
pub fn with_password(password: &'a [u8]) -> Self {
Self {
password: Some(password),
..Self::default()
}
}
pub fn with_optional_password(password: Option<&'a [u8]>) -> Self {
Self {
password,
..Self::default()
}
}
pub fn with_rar50_buffered_decode_limit(mut self, limit: u64) -> Self {
self.rar50_buffered_decode_limit = Some(limit);
self
}
}