#[non_exhaustive]pub struct MetaBlock {
pub signature: [u8; 4],
pub block_number: u64,
}Expand description
A ReFS v3 self-describing metadata-block header.
Carries the four-byte block signature and the block’s own (self) block
number. #[non_exhaustive] so later phases add the redundancy block numbers,
table identifier, and clocks without a breaking change.
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.signature: [u8; 4]The four-byte block signature (SUPB/CHKP/MSB+), validated against
the caller’s expected signature.
block_number: u64The block’s own (self) block number, at header offset 0x20.
Implementations§
Source§impl MetaBlock
impl MetaBlock
Sourcepub fn parse(
data: &[u8],
expected: &'static str,
offset: u64,
) -> Result<Self, RefsError>
pub fn parse( data: &[u8], expected: &'static str, offset: u64, ) -> Result<Self, RefsError>
Parse and validate a v3 metadata-block header at the start of data.
expected is the signature the caller requires ("SUPB", "CHKP", or
"MSB+"); offset is the block’s absolute byte position, carried into
the error so a mismatch names what was there and where (fail loud
with the value).
§Errors
RefsError::BadBlockSignatureif the first four bytes are notexpected.RefsError::Truncatedifdatais shorter than the 80-byte header.
Sourcepub fn verify_crc32c(
data: &[u8],
start: usize,
end: usize,
stored: u32,
) -> Option<bool>
pub fn verify_crc32c( data: &[u8], start: usize, end: usize, stored: u32, ) -> Option<bool>
Verify a CRC-32C over the explicit byte range data[start..end] against
a stored value.
Returns Some(true)/Some(false) when the range is in bounds, or
None when it is not (out-of-range never panics — the Paranoid
Gatekeeper standard). The range is the caller’s responsibility: ReFS’s
own block-checksum coverage range is undetermined from the available
reverse-engineered references (see the module docs), so this crate does
not guess it.