pub enum NsfError {
TooShort {
actual: usize,
required: usize,
},
BadFileSignature {
observed: [u8; 2],
},
BadHeaderSize {
size: u32,
},
BadSubrecordSignature {
kind: &'static str,
expected: [u8; 2],
observed: [u8; 2],
},
CompressionUnsupported {
structure: &'static str,
compression_type: u16,
},
BucketIndexOutOfRange {
requested: u32,
available: usize,
},
SlotIndexOutOfRange {
requested: u16,
available: u32,
},
DecompressionFailed {
detail: &'static str,
},
}Expand description
Top-level parser error.
Variants§
TooShort
File is shorter than the minimum size required to even hold a valid NSF file header (6 bytes).
Fields
BadFileSignature
The 2-byte file-header signature did not match the NSF LSIG marker
(0x1A 0x00). Likely not an NSF file at all.
BadHeaderSize
The database-header-size field in the file header is implausible (zero, larger than any documented NSF, or larger than the file itself).
BadSubrecordSignature
A subrecord (superblock, bucket descriptor block, …) signature
check failed. Distinct from Self::BadFileSignature so the
error message can identify which structure failed validation.
Fields
CompressionUnsupported
A structure required for the requested operation is stored
compressed and the parser does not yet implement the compression
scheme. The canonical case: on modern ODS the superblock body
(which carries the bucket-descriptor array that maps a
bucket_index to a file offset) is stored with Domino “CX”
compression. Resolving an crate::RrvLocation::BucketSlot entry
to bytes requires decompressing that body first. Until the CX
decompressor lands, bucket-slot resolution returns this error
rather than guessing - in a forensic context a wrong decompressor
silently corrupts evidence, which is worse than an explicit
not-yet-supported signal.
Fields
BucketIndexOutOfRange
A bucket_index from an RRV entry is past the end of the parsed
bucket-descriptor array. Indicates either corruption or a stale
(non-freshest) superblock being consulted.
Fields
SlotIndexOutOfRange
A slot_index from an RRV entry is outside the bucket’s slot
table. Slot indices are 1-based on disk; zero is never valid.
Fields
DecompressionFailed
Decompression of a compressed structure failed: the compressed
stream was truncated, a back-reference pointed before the start of
the output, or the declared output size was exceeded. Distinct from
Self::CompressionUnsupported (which means “scheme not
implemented”); this means “scheme implemented, but this input did
not decode cleanly”.
Trait Implementations§
impl Eq for NsfError
Source§impl Error for NsfError
impl Error for NsfError
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()