Skip to main content

ApfsVolume

Struct ApfsVolume 

Source
pub struct ApfsVolume<R: Read + Seek> { /* private fields */ }
Expand description

High-level read-only APFS volume reader

Implementations§

Source§

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

Source

pub fn open(reader: R) -> Result<Self>

Open an APFS container and mount the first volume.

  1. Read block 0 → parse NX superblock, validate NXSB magic + Fletcher-64
  2. Scan checkpoint descriptor area for latest valid NX superblock
  3. Read container OMAP at omap_oid physical block
  4. Find first non-zero OID in fs_oids array
  5. Resolve volume OID → physical block via container OMAP
  6. Parse volume superblock (APSB magic)
  7. Read volume OMAP at vol.omap_oid physical block
  8. Resolve vol.root_tree_oid → physical block via volume OMAP → catalog B-tree root
  9. Store all state
Source

pub fn volume_info(&self) -> &VolumeInfo

Get volume metadata

Source

pub fn list_directory(&mut self, path: &str) -> Result<Vec<DirEntry>>

List entries in a directory by path

Source

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

Read an entire file into memory

Source

pub fn read_file_to<W: Write>( &mut self, path: &str, writer: &mut W, ) -> Result<u64>

Stream a file to a writer

Source

pub fn open_file(&mut self, path: &str) -> Result<ApfsForkReader<'_, R>>

Open a file for streaming Read+Seek access

Source

pub fn stat(&mut self, path: &str) -> Result<FileStat>

Get metadata for a file or directory

Source

pub fn walk(&mut self) -> Result<Vec<WalkEntry>>

Recursive walk of all entries

Source

pub fn exists(&mut self, path: &str) -> Result<bool>

Check if a path exists

Auto Trait Implementations§

§

impl<R> Freeze for ApfsVolume<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for ApfsVolume<R>
where R: RefUnwindSafe,

§

impl<R> Send for ApfsVolume<R>
where R: Send,

§

impl<R> Sync for ApfsVolume<R>
where R: Sync,

§

impl<R> Unpin for ApfsVolume<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for ApfsVolume<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for ApfsVolume<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.

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, 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.