#[non_exhaustive]pub struct ApfsVolume { /* private fields */ }Expand description
A parsed volume superblock (subset; #[non_exhaustive] for additive growth).
The fs-tree navigation entry points (Self::root_tree_oid /
Self::omap_oid) are consumed by crate::dir for name→inode path
resolution.
Implementations§
Source§impl ApfsVolume
impl ApfsVolume
Sourcepub fn parse(block: &[u8]) -> Result<Self>
pub fn parse(block: &[u8]) -> Result<Self>
Parse and validate an APSB block (magic-by-type + signature + Fletcher-64 checksum) before trusting any field.
§Errors
crate::ApfsError::UnexpectedObjectType on a short block, a non-FS
object type, or a wrong apfs_magic signature (carrying the offending
value); crate::ApfsError::ChecksumMismatch on a Fletcher-64 failure.
Sourcepub fn xid(&self) -> u64
pub fn xid(&self) -> u64
The transaction id of this volume superblock (nx_o.o_xid). Used as the
xid for resolving virtual fs-tree oids through the volume omap.
Sourcepub fn fs_index(&self) -> u32
pub fn fs_index(&self) -> u32
apfs_fs_index — this volume’s index within the container’s nx_fs_oid[].
Sourcepub fn readonly_compatible_features(&self) -> u64
pub fn readonly_compatible_features(&self) -> u64
apfs_readonly_compatible_features — read-only-compatible feature flags.
Sourcepub fn incompatible_features(&self) -> u64
pub fn incompatible_features(&self) -> u64
apfs_incompatible_features — incompatible feature flags (the
case-insensitivity / normalization bits affect directory-name matching).
Sourcepub fn root_tree_type(&self) -> u32
pub fn root_tree_type(&self) -> u32
apfs_root_tree_type — the storage-flag + object-type word of the
file-system root tree (the root tree is virtual, so its high bits carry
the virtual storage flag).
Sourcepub fn omap_oid(&self) -> u64
pub fn omap_oid(&self) -> u64
apfs_omap_oid — the block address of this volume’s object map
(omap_phys_t, a physical object). The fs-tree’s virtual oids resolve
through this omap.
Sourcepub fn with_omap_oid(self, omap_oid: u64) -> Self
pub fn with_omap_oid(self, omap_oid: u64) -> Self
Return this volume superblock with its omap_oid replaced.
A snapshot’s frozen apfs_superblock_t carries apfs_omap_oid == 0:
snapshots have no object map of their own and are read through the
live volume’s omap, resolved at the snapshot’s xid (the omap B-tree
retains historical (oid, xid) → paddr mappings that snapshots pin). A
point-in-time view therefore keeps the frozen superblock’s root_tree_oid
and xid but borrows the live volume’s omap. See
crate::snapshot::mount_snapshot.
Sourcepub fn root_tree_oid(&self) -> u64
pub fn root_tree_oid(&self) -> u64
apfs_root_tree_oid — the virtual oid of the file-system tree root
(FSTREE). Resolve it through the volume omap (Self::omap_oid) at
Self::xid to get the root node’s physical block address.
Sourcepub fn extentref_tree_oid(&self) -> u64
pub fn extentref_tree_oid(&self) -> u64
apfs_extentref_tree_oid — the extent-reference tree oid.
Sourcepub fn snap_meta_tree_oid(&self) -> u64
pub fn snap_meta_tree_oid(&self) -> u64
apfs_snap_meta_tree_oid — the snapshot-metadata tree oid.
Trait Implementations§
Source§impl Clone for ApfsVolume
impl Clone for ApfsVolume
Source§fn clone(&self) -> ApfsVolume
fn clone(&self) -> ApfsVolume
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more