#[non_exhaustive]pub struct NxSuperblock {Show 13 fields
pub xid: u64,
pub uuid: [u8; 16],
pub block_size: u32,
pub block_count: u64,
pub incompatible_features: u64,
pub xp_desc_base: u64,
pub xp_desc_blocks: u32,
pub xp_data_base: u64,
pub xp_data_blocks: u32,
pub omap_oid: u64,
pub spaceman_oid: u64,
pub reaper_oid: u64,
pub fs_oids: Vec<u64>,
/* private fields */
}Expand description
A parsed container superblock (subset; #[non_exhaustive] for additive growth).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.xid: u64Transaction id of this superblock (nx_o.o_xid).
uuid: [u8; 16]Container UUID (nx_uuid).
block_size: u32nx_block_size — the authoritative block size (never assumed).
block_count: u64nx_block_count.
incompatible_features: u64nx_incompatible_features — feature bits a reader must understand to
mount safely (e.g. NX_INCOMPAT_FUSION); an unrecognised bit means the
image cannot be read correctly.
xp_desc_base: u64Checkpoint descriptor-area base (nx_xp_desc_base) — a block address
when contiguous, or a B-tree oid when Self::xp_desc_is_tree.
xp_desc_blocks: u32Checkpoint descriptor-area length in blocks (nx_xp_desc_blocks, flag
bit already masked off).
xp_data_base: u64Checkpoint data-area base (nx_xp_data_base).
xp_data_blocks: u32Checkpoint data-area length in blocks (nx_xp_data_blocks, flag bit masked).
omap_oid: u64Container object-map oid (nx_omap_oid).
spaceman_oid: u64Space-manager ephemeral oid (nx_spaceman_oid) — resolve to a paddr via
the checkpoint map.
reaper_oid: u64Reaper ephemeral oid (nx_reaper_oid) — resolve to a paddr via the
checkpoint map.
fs_oids: Vec<u64>Volume oids (nx_fs_oid[]), one per APSB volume (trailing zeros trimmed).
Implementations§
Source§impl NxSuperblock
impl NxSuperblock
Sourcepub fn parse(block: &[u8]) -> Result<Self>
pub fn parse(block: &[u8]) -> Result<Self>
Parse and validate an NXSB from a block (checks magic + checksum).
§Errors
crate::ApfsError::NoValidSuperblock on a short block or bad magic
(carrying the offending magic value);
crate::ApfsError::ChecksumMismatch on a Fletcher-64 failure
(carrying both the stored and computed checksums).
Sourcepub fn xp_desc_is_tree(&self) -> bool
pub fn xp_desc_is_tree(&self) -> bool
Whether the checkpoint descriptor area is stored as a B-tree (high bit of
nx_xp_desc_blocks set) rather than a contiguous run. A contiguous area
can be walked directly; a tree-backed one needs B-tree resolution (P2).
Sourcepub fn xp_data_is_tree(&self) -> bool
pub fn xp_data_is_tree(&self) -> bool
Whether the checkpoint data area is stored as a B-tree.
Trait Implementations§
Source§impl Clone for NxSuperblock
impl Clone for NxSuperblock
Source§fn clone(&self) -> NxSuperblock
fn clone(&self) -> NxSuperblock
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more