Skip to main content

FxarReader

Struct FxarReader 

Source
pub struct FxarReader<R: Read + Seek> {
    pub header: FxarHeader,
    /* private fields */
}
Expand description

Read an FXAR v2 archive with random access.

Fields§

§header: FxarHeader

Implementations§

Source§

impl<R: Read + Seek> FxarReader<R>

Source

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.

Source

pub fn read_manifest(&mut self) -> Result<FxarManifest>

Read and parse the manifest.

Source

pub fn read_chunk_index(&mut self) -> Result<Vec<ChunkIndexEntry>>

Read the chunk index.

Source

pub fn restore_file(&mut self, file_path: &str) -> Result<Vec<u8>>

Restore a single file by path from the archive.

Source

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.

Source

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.

Source

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.

Source

pub fn list_files(&mut self) -> Result<Vec<FxarManifestEntry>>

List all files in the archive without extracting.

Source

pub fn read_extension_directory( &mut self, ) -> Result<Option<FxarExtensionDirectory>>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more