Skip to main content

RefsError

Enum RefsError 

Source
#[non_exhaustive]
pub enum RefsError { Truncated { structure: &'static str, need: usize, have: usize, }, BadSignature { found: [u8; 8], }, BadFsrs { found: [u8; 4], found_ascii: String, }, BadBlockSignature { found: [u8; 4], found_ascii: String, expected: &'static str, offset: u64, }, ObjectIdNotFound { object_id: u64, }, UnresolvedVirtualBlock { block: u64, }, UnsupportedVersion { major: u8, minor: u8, }, }
Expand description

Errors surfaced while parsing ReFS on-disk structures.

Every variant names the offending value so an “unknown/invalid” report hands the investigator the evidence (raw bytes / offset / version), never a bare “invalid” (the fail-loud, show-the-unrecognized-value standard).

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Truncated

The buffer was too small to hold the structure being parsed.

Fields

§structure: &'static str

Name of the structure that could not be read.

§need: usize

Minimum byte length required.

§have: usize

Byte length actually available.

§

BadSignature

The ReFS file-system signature at boot offset 3 was not "ReFS\0\0\0\0". Carries the eight bytes actually found so the caller can identify what the image really is (fail-loud with the offending value).

Fields

§found: [u8; 8]

The eight raw bytes at boot offset 3.

§

BadFsrs

The file-system recognition-structure identifier at boot offset 16 was not "FSRS". Carries the four bytes actually found.

Fields

§found: [u8; 4]

The four raw bytes at boot offset 16.

§found_ascii: String

Best-effort ASCII rendering of found (non-printables as .).

§

BadBlockSignature

A ReFS metadata block did not carry the expected block signature (SUPB superblock, CHKP checkpoint, MSB+ ministore).

Carries the offending four bytes and the byte offset where they were found, so the investigator sees what was there and where — never a silently-skipped block.

Fields

§found: [u8; 4]

The four raw bytes at the block’s signature position.

§found_ascii: String

Best-effort ASCII rendering of found (non-printables as .).

§expected: &'static str

The signature that was expected (e.g. "SUPB").

§offset: u64

Absolute byte offset of the signature in the image/buffer.

§

ObjectIdNotFound

The object table did not contain the requested object identifier.

Surfaced (rather than an empty listing) when a directory walk asks the object table for an id it does not carry — the fail-loud, show-the-value standard: the missing id is named so the investigator can tell “empty directory” from “object not found”.

Fields

§object_id: u64

The object identifier that was looked up and not found.

§

UnresolvedVirtualBlock

An object’s tree-root block number is a virtual address that this phase cannot resolve to a physical location.

In ReFS v3.x the object table stores virtual block numbers; resolving them to physical offsets requires the container table (a later phase). When a lookup lands on a block outside the physically-resident region, the walk fails loud with the offending virtual block number rather than silently returning an empty result (a bootstrap/resolution failure must never be indistinguishable from a genuinely empty directory).

Fields

§block: u64

The unresolved virtual block number named by the object table.

§

UnsupportedVersion

The ReFS major format version is not one this reader supports.

This reader targets ReFS v3.x (Server 2016+/Win10 1803+/Win11). A v1 volume (Server 2012 / 8.1) has a materially different on-disk layout and is deliberately rejected rather than silently misparsed. Carries the actual major/minor bytes so the investigator sees the real version (the fail-loud gate RESEARCH.md mandates: “never silently misparse”).

Fields

§major: u8

The Major format version byte at boot offset 40.

§minor: u8

The Minor format version byte at boot offset 41.

Trait Implementations§

Source§

impl Debug for RefsError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RefsError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for RefsError

Source§

impl Error for RefsError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for RefsError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RefsError

Auto Trait Implementations§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.