pub struct OmniExtractor { /* private fields */ }Expand description
omni.ja archive extractor
Handles extraction of preference files from omni.ja ZIP archives with caching, security validations, and size limits.
§Example
use ffcv::OmniExtractor;
use std::path::PathBuf;
let omni_path = PathBuf::from("/usr/lib/firefox/omni.ja");
let extractor = OmniExtractor::new(omni_path).unwrap();
let extracted_files = extractor.extract_prefs().unwrap();
for file in extracted_files {
println!("Extracted: {:?}", file);
}Implementations§
Source§impl OmniExtractor
impl OmniExtractor
Sourcepub fn with_config(omni_path: PathBuf, config: ExtractConfig) -> Result<Self>
pub fn with_config(omni_path: PathBuf, config: ExtractConfig) -> Result<Self>
Sourcepub fn extract_prefs(&self) -> Result<Vec<PathBuf>>
pub fn extract_prefs(&self) -> Result<Vec<PathBuf>>
Extract preference files from omni.ja
This method extracts JavaScript preference files from the omni.ja archive, using cache if available and valid.
§Returns
Ok(files)- Vector of extracted file pathsErr(_)- Error during extraction
Sourcepub fn list_js_files(&self) -> Result<Vec<String>>
pub fn list_js_files(&self) -> Result<Vec<String>>
List all JavaScript files in the archive
§Returns
Ok(files)- Vector of JavaScript file namesErr(_)- Error reading archive
Sourcepub fn clear_cache(&self) -> Result<()>
pub fn clear_cache(&self) -> Result<()>
Clear the extraction cache
Auto Trait Implementations§
impl Freeze for OmniExtractor
impl RefUnwindSafe for OmniExtractor
impl Send for OmniExtractor
impl Sync for OmniExtractor
impl Unpin for OmniExtractor
impl UnwindSafe for OmniExtractor
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