pub struct FxarReader<R: Read + Seek> {
pub header: FxarHeader,
/* private fields */
}Expand description
Read an FXAR v2 archive with random access.
Fields§
§header: FxarHeaderImplementations§
Source§impl<R: Read + Seek> FxarReader<R>
impl<R: Read + Seek> FxarReader<R>
Sourcepub fn open(reader: R) -> Result<Self>
pub fn open(reader: R) -> Result<Self>
Open an FXAR v2 archive for reading.
Automatically handles streaming-mode archives whose header has placeholder offsets (manifest_offset=0, index_offset=0) by falling back to the footer.
Sourcepub fn read_manifest(&mut self) -> Result<FxarManifest>
pub fn read_manifest(&mut self) -> Result<FxarManifest>
Read and parse the manifest.
Sourcepub fn read_chunk_index(&mut self) -> Result<Vec<ChunkIndexEntry>>
pub fn read_chunk_index(&mut self) -> Result<Vec<ChunkIndexEntry>>
Read the chunk index.
Sourcepub fn restore_file(&mut self, file_path: &str) -> Result<Vec<u8>>
pub fn restore_file(&mut self, file_path: &str) -> Result<Vec<u8>>
Restore a single file by path from the archive.
Sourcepub fn restore_file_head(
&mut self,
file_path: &str,
max_bytes: usize,
) -> Result<Vec<u8>>
pub fn restore_file_head( &mut self, file_path: &str, max_bytes: usize, ) -> Result<Vec<u8>>
Read the first max_bytes of a file from the archive without
verifying the whole-file BLAKE3 hash (partial reads cannot be
hash-verified). Per-chunk BLAKE3 is still checked.
Returns fewer than max_bytes if the file is smaller.
Sourcepub fn restore_all(
&mut self,
target: &Path,
generate_sigs: bool,
) -> Result<FxarImportStats>
pub fn restore_all( &mut self, target: &Path, generate_sigs: bool, ) -> Result<FxarImportStats>
Restore all files to a target directory.
Pipelined: chunk loading overlaps with file writing. Producer thread reads chunks sequentially; consumer rayon threads write files as soon as their chunks become available.
Sourcepub fn restore_latest(
&mut self,
target: &Path,
generate_sigs: bool,
verbose: bool,
) -> Result<FxarImportStats>
pub fn restore_latest( &mut self, target: &Path, generate_sigs: bool, verbose: bool, ) -> Result<FxarImportStats>
Restore latest version of each file, stripping {snapshot}/tree/ prefix.
Default restore mode – behaves like tar -xvf. When an archive contains
multiple snapshots with the same file, only the most recent version is
extracted. Output paths are flat relative paths (no snapshot prefix).
When verbose is true, prints per-file version info to stderr.
Sourcepub fn list_files(&mut self) -> Result<Vec<FxarManifestEntry>>
pub fn list_files(&mut self) -> Result<Vec<FxarManifestEntry>>
List all files in the archive without extracting.
pub fn read_extension_directory( &mut self, ) -> Result<Option<FxarExtensionDirectory>>
pub fn read_extension_section( &mut self, section_type: u32, ) -> Result<Option<Vec<u8>>>
Auto Trait Implementations§
impl<R> Freeze for FxarReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for FxarReader<R>where
R: RefUnwindSafe,
impl<R> Send for FxarReader<R>where
R: Send,
impl<R> Sync for FxarReader<R>where
R: Sync,
impl<R> Unpin for FxarReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for FxarReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for FxarReader<R>where
R: UnwindSafe,
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more