#[non_exhaustive]pub enum XfsError {
Truncated {
structure: &'static str,
need: usize,
have: usize,
},
BadMagic {
found: u32,
bytes: [u8; 4],
},
UnsupportedDir {
detail: String,
},
PathNotFound {
path: String,
component: String,
},
}Expand description
Errors surfaced while parsing XFS on-disk structures.
Every variant names the offending value so an “unknown/invalid” report hands the investigator the evidence (raw bytes / offset), never a bare “invalid”.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
The buffer was too small to hold the structure being parsed.
Fields
BadMagic
The superblock magic number did not match XFSB (0x5846_5342).
Carries the four bytes actually found so the caller can identify what the image really is (fail-loud with the offending value).
Fields
UnsupportedDir
A directory used a format this reader does not yet handle (leaf / node / btree), or a block directory carried an unrecognized data-block magic.
Fail-loud rather than return an empty listing: detail names the format
and the offending value (magic bytes / size), so the investigator sees
what could not be read, never a silently-empty directory.
PathNotFound
A path component did not resolve during crate::read_by_path: the named
component was not found in its parent directory, or a non-final component
was not itself a directory. Carries the offending path and component.
Trait Implementations§
impl Eq for XfsError
Source§impl Error for XfsError
impl Error for XfsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()