#[non_exhaustive]pub struct ContainerResolver { /* private fields */ }Expand description
A virtual → physical block resolver built from the physically resident metadata of a ReFS image.
Each resident Minstore page’s self-block-number (header offset 0x20) is
ground truth for its container’s physical base; scanning them yields a
container_index → physical_base_cluster map. Resolving a virtual block then
decomposes it and applies the base. See the module docs for why this
evidence-based bootstrap is used rather than the (many-to-one, index-tree
dependent) container-tree band enumeration.
Implementations§
Source§impl ContainerResolver
impl ContainerResolver
Sourcepub fn from_resident_image(image: &[u8], band_clusters: u64) -> Self
pub fn from_resident_image(image: &[u8], band_clusters: u64) -> Self
Build a resolver by scanning image for physically resident Minstore
pages and recording each container’s physical base from the pages’
self-block-numbers.
band_clusters is the band size in clusters
(boot.container_size / cluster_size; 16_384 on the v3.14 oracle).
Sourcepub fn resolve_virtual(&self, vblock: u64) -> Option<u64>
pub fn resolve_virtual(&self, vblock: u64) -> Option<u64>
Resolve a virtual block number to a physical byte offset, or None if
its container index was never witnessed in the resident metadata (an
unresolved virtual address — the caller must treat this as a hard wall,
not an empty result).
Sourcepub fn resolve_virtual_checked(&self, vblock: u64) -> Result<u64, RefsError>
pub fn resolve_virtual_checked(&self, vblock: u64) -> Result<u64, RefsError>
Resolve a virtual block number, failing loud with the offending block
number when it cannot be mapped (rather than a silent None).
§Errors
RefsError::UnresolvedVirtualBlock naming vblock when its container
index has no resident base mapping (or the computed offset overflows).