Enum ntfs::NtfsError

source ·
#[non_exhaustive]
pub enum NtfsError {
Show 49 variants AttributeNotFound { position: NtfsPosition, ty: NtfsAttributeType, }, AttributeOfDifferentType { position: NtfsPosition, expected: NtfsAttributeType, actual: NtfsAttributeType, }, BufferTooSmall { expected: usize, actual: usize, }, InvalidAttributeLength { position: NtfsPosition, expected: usize, actual: usize, }, InvalidAttributeNameLength { position: NtfsPosition, expected: usize, actual: u32, }, InvalidAttributeNameOffset { position: NtfsPosition, expected: u16, actual: u32, }, InvalidByteCountInDataRunHeader { position: NtfsPosition, expected: u8, actual: u8, }, InvalidClusterCountInDataRunHeader { position: NtfsPosition, cluster_count: u64, }, InvalidFileAllocatedSize { position: NtfsPosition, expected: u32, actual: u32, }, InvalidFileRecordNumber { file_record_number: u64, }, InvalidFileSignature { position: NtfsPosition, expected: &'static [u8], actual: [u8; 4], }, InvalidFileUsedSize { position: NtfsPosition, expected: u32, actual: u32, }, InvalidIndexAllocatedSize { position: NtfsPosition, expected: u32, actual: u32, }, InvalidIndexEntryDataRange { position: NtfsPosition, range: Range<usize>, size: u16, }, InvalidIndexEntrySize { position: NtfsPosition, expected: u16, actual: u16, }, InvalidIndexRootEntriesOffset { position: NtfsPosition, expected: usize, actual: usize, }, InvalidIndexRootUsedSize { position: NtfsPosition, expected: usize, actual: usize, }, InvalidIndexSignature { position: NtfsPosition, expected: &'static [u8], actual: [u8; 4], }, InvalidIndexUsedSize { position: NtfsPosition, expected: u32, actual: u32, }, InvalidMftLcn, InvalidNonResidentValueDataRange { position: NtfsPosition, range: Range<usize>, size: usize, }, InvalidResidentAttributeValueLength { position: NtfsPosition, length: u32, offset: u16, actual: u32, }, InvalidResidentAttributeValueOffset { position: NtfsPosition, expected: u16, actual: u32, }, InvalidRecordSizeInfo { size_info: i8, cluster_size: u32, }, InvalidSectorsPerCluster { sectors_per_cluster: u8, }, InvalidStructuredValueSize { position: NtfsPosition, ty: NtfsAttributeType, expected: u64, actual: u64, }, InvalidTime, InvalidTwoByteSignature { position: NtfsPosition, expected: &'static [u8], actual: [u8; 2], }, InvalidUpcaseTableSize { expected: u64, actual: u64, }, InvalidUpdateSequenceCount { position: NtfsPosition, update_sequence_count: u16, }, InvalidUpdateSequenceNumberRange { position: NtfsPosition, range: Range<usize>, size: usize, }, InvalidVcnInDataRunHeader { position: NtfsPosition, vcn: Vcn, previous_lcn: Lcn, }, Io(Error), LcnTooBig { lcn: Lcn, }, MissingIndexAllocation { position: NtfsPosition, }, NotADirectory { position: NtfsPosition, }, TotalSectorsTooBig { total_sectors: u64, }, UnexpectedAttributeListAttribute { position: NtfsPosition, }, UnexpectedNonResidentAttribute { position: NtfsPosition, }, UnexpectedResidentAttribute { position: NtfsPosition, }, UnsupportedAttributeType { position: NtfsPosition, actual: u32, }, UnsupportedClusterSize { min: u32, max: u32, actual: u32, }, UnsupportedFileNamespace { position: NtfsPosition, actual: u8, }, UnsupportedSectorSize { min: u16, max: u16, actual: u16, }, UpdateSequenceArrayExceedsRecordSize { position: NtfsPosition, array_count: u16, record_size: usize, }, UpdateSequenceNumberMismatch { position: NtfsPosition, expected: [u8; 2], actual: [u8; 2], }, VcnMismatchInIndexAllocation { position: NtfsPosition, expected: Vcn, actual: Vcn, }, VcnOutOfBoundsInIndexAllocation { position: NtfsPosition, vcn: Vcn, }, VcnTooBig { vcn: Vcn, },
}
Expand description

Central error type of ntfs.

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.
§

AttributeNotFound

The NTFS file at byte position {position:#x} has no attribute of type {ty:?}, but it was expected

§

AttributeOfDifferentType

The NTFS Attribute at byte position {position:#x} should have type {expected:?}, but it actually has type {actual:?}

§

BufferTooSmall

Fields

§expected: usize
§actual: usize

The given buffer should have at least {expected} bytes, but it only has {actual} bytes

§

InvalidAttributeLength

Fields

§position: NtfsPosition
§expected: usize
§actual: usize

The NTFS Attribute at byte position {position:#x} has a length of {expected} bytes, but only {actual} bytes are left in the record

§

InvalidAttributeNameLength

Fields

§position: NtfsPosition
§expected: usize
§actual: u32

The NTFS Attribute at byte position {position:#x} indicates a name length up to offset {expected}, but the attribute only has a size of {actual} bytes

§

InvalidAttributeNameOffset

Fields

§position: NtfsPosition
§expected: u16
§actual: u32

The NTFS Attribute at byte position {position:#x} indicates that its name starts at offset {expected}, but the attribute only has a size of {actual} bytes

§

InvalidByteCountInDataRunHeader

Fields

§position: NtfsPosition
§expected: u8
§actual: u8

The NTFS Data Run header at byte position {position:#x} indicates a maximum byte count of {expected}, but {actual} is the limit

§

InvalidClusterCountInDataRunHeader

Fields

§position: NtfsPosition
§cluster_count: u64

The cluster count {cluster_count} read from the NTFS Data Run header at byte position {position:#x} is invalid

§

InvalidFileAllocatedSize

Fields

§position: NtfsPosition
§expected: u32
§actual: u32

The NTFS File Record at byte position {position:#x} indicates an allocated size of {expected} bytes, but the record only has a size of {actual} bytes

§

InvalidFileRecordNumber

Fields

§file_record_number: u64

The requested NTFS File Record Number {file_record_number} is invalid

§

InvalidFileSignature

Fields

§position: NtfsPosition
§expected: &'static [u8]
§actual: [u8; 4]

The NTFS File Record at byte position {position:#x} should have signature {expected:?}, but it has signature {actual:?}

§

InvalidFileUsedSize

Fields

§position: NtfsPosition
§expected: u32
§actual: u32

The NTFS File Record at byte position {position:#x} indicates a used size of {expected} bytes, but only {actual} bytes are allocated

§

InvalidIndexAllocatedSize

Fields

§position: NtfsPosition
§expected: u32
§actual: u32

The NTFS Index Record at byte position {position:#x} indicates an allocated size of {expected} bytes, but the record only has a size of {actual} bytes

§

InvalidIndexEntryDataRange

Fields

§position: NtfsPosition
§range: Range<usize>
§size: u16

The NTFS Index Entry at byte position {position:#x} references a data field in the range {range:?}, but the entry only has a size of {size} bytes

§

InvalidIndexEntrySize

Fields

§position: NtfsPosition
§expected: u16
§actual: u16

The NTFS Index Entry at byte position {position:#x} reports a size of {expected} bytes, but it only has {actual} bytes

§

InvalidIndexRootEntriesOffset

Fields

§position: NtfsPosition
§expected: usize
§actual: usize

The NTFS index root at byte position {position:#x} indicates that its entries start at offset {expected}, but the index root only has a size of {actual} bytes

§

InvalidIndexRootUsedSize

Fields

§position: NtfsPosition
§expected: usize
§actual: usize

The NTFS index root at byte position {position:#x} indicates a used size up to offset {expected}, but the index root only has a size of {actual} bytes

§

InvalidIndexSignature

Fields

§position: NtfsPosition
§expected: &'static [u8]
§actual: [u8; 4]

The NTFS Index Record at byte position {position:#x} should have signature {expected:?}, but it has signature {actual:?}

§

InvalidIndexUsedSize

Fields

§position: NtfsPosition
§expected: u32
§actual: u32

The NTFS Index Record at byte position {position:#x} indicates a used size of {expected} bytes, but only {actual} bytes are allocated

§

InvalidMftLcn

The MFT LCN in the BIOS Parameter Block of the NTFS filesystem is invalid.

§

InvalidNonResidentValueDataRange

Fields

§position: NtfsPosition
§range: Range<usize>
§size: usize

The NTFS Non Resident Value Data at byte position {position:#x} references a data field in the range {range:?}, but the entry only has a size of {size} bytes

§

InvalidResidentAttributeValueLength

Fields

§position: NtfsPosition
§length: u32
§offset: u16
§actual: u32

The resident NTFS Attribute at byte position {position:#x} indicates a value length of {length} starting at offset {offset}, but the attribute only has a size of {actual} bytes

§

InvalidResidentAttributeValueOffset

Fields

§position: NtfsPosition
§expected: u16
§actual: u32

The resident NTFS Attribute at byte position {position:#x} indicates that its value starts at offset {expected}, but the attribute only has a size of {actual} bytes

§

InvalidRecordSizeInfo

Fields

§size_info: i8
§cluster_size: u32

A record size field in the BIOS Parameter Block denotes {size_info}, which is invalid considering the cluster size of {cluster_size} bytes

§

InvalidSectorsPerCluster

Fields

§sectors_per_cluster: u8

The sectors per cluster field in the BIOS Parameter Block denotes {sectors_per_cluster:#04x}, which is invalid

§

InvalidStructuredValueSize

Fields

§position: NtfsPosition
§expected: u64
§actual: u64

The NTFS structured value at byte position {position:#x} of type {ty:?} has {actual} bytes where {expected} bytes were expected

§

InvalidTime

The given time can’t be represented as an NtfsTime

§

InvalidTwoByteSignature

Fields

§position: NtfsPosition
§expected: &'static [u8]
§actual: [u8; 2]

The 2-byte signature field at byte position {position:#x} should contain {expected:?}, but it contains {actual:?}

§

InvalidUpcaseTableSize

Fields

§expected: u64
§actual: u64

The Upcase Table should have a size of {expected} bytes, but it has {actual} bytes

§

InvalidUpdateSequenceCount

Fields

§position: NtfsPosition
§update_sequence_count: u16

The NTFS Update Sequence Count of the record at byte position {position:#x} has the invalid value {update_sequence_count}

§

InvalidUpdateSequenceNumberRange

Fields

§position: NtfsPosition
§range: Range<usize>
§size: usize

The NTFS Update Sequence Number of the record at byte position {position:#x} references a data field in the range {range:?}, but the entry only has a size of {size} bytes

§

InvalidVcnInDataRunHeader

Fields

§position: NtfsPosition
§vcn: Vcn
§previous_lcn: Lcn

The VCN {vcn} read from the NTFS Data Run header at byte position {position:#x} cannot be added to the LCN {previous_lcn} calculated from previous data runs

§

Io(Error)

I/O error: {0:?}

§

LcnTooBig

Fields

§lcn: Lcn

The Logical Cluster Number (LCN) {lcn} is too big to be multiplied by the cluster size

§

MissingIndexAllocation

Fields

§position: NtfsPosition

The index root at byte position {position:#x} is a large index, but no matching index allocation attribute was provided

§

NotADirectory

Fields

§position: NtfsPosition

The NTFS file at byte position {position:#x} is not a directory

§

TotalSectorsTooBig

Fields

§total_sectors: u64

The total sector count is too big to be multiplied by the sector size

§

UnexpectedAttributeListAttribute

Fields

§position: NtfsPosition

The NTFS Attribute at byte position {position:#x} should not belong to an Attribute List, but it does

§

UnexpectedNonResidentAttribute

Fields

§position: NtfsPosition

The NTFS Attribute at byte position {position:#x} should be resident, but it is non-resident

§

UnexpectedResidentAttribute

Fields

§position: NtfsPosition

The NTFS Attribute at byte position {position:#x} should be non-resident, but it is resident

§

UnsupportedAttributeType

Fields

§position: NtfsPosition
§actual: u32

The type of the NTFS Attribute at byte position {position:#x} is {actual:#010x}, which is not supported

§

UnsupportedClusterSize

Fields

§min: u32
§max: u32
§actual: u32

The cluster size is {actual} bytes, but it needs to be between {min} and {max}

§

UnsupportedFileNamespace

Fields

§position: NtfsPosition
§actual: u8

The namespace of the NTFS file name starting at byte position {position:#x} is {actual}, which is not supported

§

UnsupportedSectorSize

Fields

§min: u16
§max: u16
§actual: u16

The sector size is {actual} bytes, but it needs to be between {min} and {max}

§

UpdateSequenceArrayExceedsRecordSize

Fields

§position: NtfsPosition
§array_count: u16
§record_size: usize

The Update Sequence Array (USA) of the record at byte position {position:#x} has entries for {array_count} blocks of 512 bytes, but the record is only {record_size} bytes long

§

UpdateSequenceNumberMismatch

Fields

§position: NtfsPosition
§expected: [u8; 2]
§actual: [u8; 2]

Sector corruption: The 2 bytes at byte position {position:#x} should match the Update Sequence Number (USN) {expected:?}, but they are {actual:?}

§

VcnMismatchInIndexAllocation

Fields

§position: NtfsPosition
§expected: Vcn
§actual: Vcn

The index allocation at byte position {position:#x} references a Virtual Cluster Number (VCN) {expected}, but a record with VCN {actual} is found at that offset

§

VcnOutOfBoundsInIndexAllocation

Fields

§position: NtfsPosition
§vcn: Vcn

The index allocation at byte position {position:#x} references a Virtual Cluster Number (VCN) {vcn}, but this VCN exceeds the boundaries of the filesystem

§

VcnTooBig

Fields

§vcn: Vcn

The Virtual Cluster Number (VCN) {vcn} is too big to be multiplied by the cluster size

Trait Implementations§

source§

impl Debug for NtfsError

source§

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

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

impl Display for NtfsError

source§

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

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

impl Error for NtfsError

Available on crate feature std only.
1.30.0 · source§

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

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, demand: &mut Demand<'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 From<Error> for NtfsError

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for NtfsError

source§

fn from(error: Error) -> Self

Converts to this type from the input type.
source§

impl From<NtfsError> for Error

source§

fn from(error: NtfsError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CustomError for Twhere T: Display + Debug + Send + Sync + 'static,

source§

fn as_any(&self) -> &(dyn Any + Send + Sync + 'static)

source§

fn as_any_mut(&mut self) -> &mut (dyn Any + Send + Sync + 'static)

source§

fn as_box_any(self: Box<T, Global>) -> Box<dyn Any + Send + Sync, Global>

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

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

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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.