pub enum NtfsError {
Show 19 variants
TooShort {
what: &'static str,
need: usize,
got: usize,
},
BadOemId([u8; 8]),
BadBytesPerSector(u16),
BadSectorsPerCluster(u8),
BadRecordSize(u8),
BadIndexRecordSize(u8),
BadRecordSignature([u8; 4]),
FixupMismatch {
sector: usize,
expected: u16,
found: u16,
},
BadUpdateSequence(&'static str),
BadAttribute {
offset: usize,
detail: &'static str,
},
BadRunlist(&'static str),
BadIndex(&'static str),
BadCompression(&'static str),
BadAttributeList(&'static str),
NotFound(String),
NotADirectory(String),
TooLarge {
bytes: u64,
},
Usn(String),
Io(Error),
}Expand description
Errors produced while parsing NTFS structures.
Variants§
TooShort
The input slice was shorter than the structure requires.
BadOemId([u8; 8])
The OEM ID at offset 3 was not b"NTFS ".
BadBytesPerSector(u16)
Bytes-per-sector is not a power of two in the range 256..=4096.
BadSectorsPerCluster(u8)
Sectors-per-cluster is zero or not a power of two.
BadRecordSize(u8)
The clusters-per-file-record-segment byte encodes an out-of-range size.
BadIndexRecordSize(u8)
The clusters-per-index-buffer byte encodes an out-of-range size.
BadRecordSignature([u8; 4])
An MFT record’s signature was neither FILE nor BAAD.
FixupMismatch
An update-sequence fixup did not match the Update Sequence Number — the record was torn across a sector boundary, or has been tampered with.
BadUpdateSequence(&'static str)
The update sequence array is malformed (offset/count out of bounds).
BadAttribute
An attribute is corrupt or would read out of bounds — rejected rather than trusted (defends against crafted records).
BadRunlist(&'static str)
A data runlist is malformed (bad field size, truncated, or overflowing).
BadIndex(&'static str)
A directory index node or entry is malformed.
BadCompression(&'static str)
LZNT1-compressed data is malformed.
BadAttributeList(&'static str)
An $ATTRIBUTE_LIST entry is malformed.
NotFound(String)
A path component was not found.
NotADirectory(String)
A path component that should be a directory is not one.
TooLarge
A structure declared a size that would require an unreasonable allocation — refused rather than attempted (defends against crafted sizes / allocation bombs).
Usn(String)
A $UsnJrnl change-journal record was malformed (bad length, truncated,
or an unsupported version) — rejected rather than trusted.
Io(Error)
An underlying I/O error.
Trait Implementations§
Source§impl Error for NtfsError
impl Error for NtfsError
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()