1#![cfg_attr(feature = "fast", feature(portable_simd))]
2
3pub mod detect;
11pub mod error;
12pub mod features;
13pub mod rar13;
14pub mod rar15_40;
15pub mod rar50;
16pub mod version;
17
18mod fast;
19mod io_util;
20#[cfg(feature = "parallel")]
21mod parallel;
22mod source;
23mod volume_extract;
24mod x86_filter_scan;
25
26pub use detect::{detect_archive_family, find_archive_start, ArchiveSignature, SFX_SCAN_LIMIT};
27pub use error::{Error, Result};
28pub use features::FeatureSet;
29pub use version::{ArchiveFamily, ArchiveVersion};
30
31#[derive(Debug, Clone, Copy, Default)]
32#[non_exhaustive]
33pub struct ArchiveReadOptions<'a> {
35 pub password: Option<&'a [u8]>,
37 pub rar50_buffered_decode_limit: Option<u64>,
43}
44
45impl<'a> ArchiveReadOptions<'a> {
46 pub fn new() -> Self {
48 Self::default()
49 }
50
51 pub fn with_password(password: &'a [u8]) -> Self {
53 Self {
54 password: Some(password),
55 ..Self::default()
56 }
57 }
58
59 pub fn with_optional_password(password: Option<&'a [u8]>) -> Self {
61 Self {
62 password,
63 ..Self::default()
64 }
65 }
66
67 pub fn with_rar50_buffered_decode_limit(mut self, limit: u64) -> Self {
69 self.rar50_buffered_decode_limit = Some(limit);
70 self
71 }
72}