#[non_exhaustive]pub enum Error {
Show 46 variants
Io(Error),
InvalidFile(String),
InvalidSignature {
position: SignaturePosition,
expected: [u8; 8],
found: [u8; 8],
},
CorruptedHeader(String),
HeaderLogGuidMismatch {
header1_log_guid: Guid,
header2_log_guid: Guid,
},
HeaderSequenceNumberInvalid {
sequence_number_1: u64,
sequence_number_2: u64,
},
UnsupportedVersion {
version: u16,
},
UnsupportedLogVersion {
version: u16,
},
HeaderLogNotAligned {
field: String,
value: u64,
},
InvalidChecksum {
expected: u32,
actual: u32,
},
InvalidBlockState(u8),
InvalidSectorBitmapState(u8),
StateMismatch {
state: u8,
description: String,
},
BatFileOffsetUnaligned {
offset_mb: u64,
block_size: u32,
},
BatEntryCountInsufficient {
actual: u64,
expected: u64,
},
BatFileOffsetDuplicate {
offset_mb: u64,
},
InvalidRegionTable(String),
RegionRequiredUnknown {
guid: Guid,
},
RegionOptionalUnknown {
guid: Guid,
},
InvalidMetadata(String),
MetadataGuidUnknown {
guid: Guid,
},
MetadataRequiredMissing {
guid: Guid,
},
MetadataRequiredUnknown {
guid: Guid,
},
MetadataOptionalUnknown {
guid: Guid,
},
MetadataReservedFlagsSet {
flags: u32,
},
MetadataEntryReservedNonzero {
reserved: u32,
},
FileParametersReservedFlags {
flags: u32,
},
InvalidParentLocator(String),
MetadataNotFound {
guid: Guid,
},
LogReplayRequired,
LogEntryCorrupted(String),
LogSequenceGap {
expected: u64,
found: u64,
},
LogSequenceGuidMismatch {
entry_log_guid: Guid,
header_log_guid: Guid,
},
LogActiveSequenceEmpty,
BatEntryNotFound {
index: u64,
},
BlockNotPresent {
block_idx: u64,
state: String,
},
SectorOutOfBounds {
sector: u64,
max: u64,
},
ParentNotFound,
ParentResolverRequired,
ParentSectorSizeMismatch {
child: u32,
parent: u32,
},
ParentMismatch {
expected: Guid,
actual: Guid,
},
ParentLocatorGuidMismatch {
expected: Guid,
actual: Guid,
},
ParentLocatorMissingLinkage,
ParentLocatorLinkage2Conflict,
InvalidParameter(String),
ReadOnly,
}Expand description
Error type for VHDX operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
InvalidFile(String)
InvalidSignature
CorruptedHeader(String)
HeaderLogGuidMismatch
HeaderSequenceNumberInvalid
UnsupportedVersion
UnsupportedLogVersion
HeaderLogNotAligned
Header LogLength or LogOffset is not aligned to 1 MB.
Standard: MS-VHDX-校验扩展标准 §4.1 — HEADER_LOG_LENGTH_NOT_ALIGNED / HEADER_LOG_OFFSET_NOT_ALIGNED
Fields
InvalidChecksum
InvalidBlockState(u8)
InvalidSectorBitmapState(u8)
StateMismatch
BAT block state is valid but incompatible with the disk type (e.g. Unmapped on non-differencing disk, or sector bitmap Present on non-differencing).
Standard: MS-VHDX-校验扩展标准 §4.3 — BAT_ENTRY_STATE_MISMATCH
Fields
BatFileOffsetUnaligned
BAT entry file offset is not aligned to the block size boundary.
Standard: MS-VHDX-校验扩展标准 §4.3 — BAT_ENTRY_FILE_OFFSET_UNALIGNED
Fields
BatEntryCountInsufficient
BatFileOffsetDuplicate
InvalidRegionTable(String)
RegionRequiredUnknown
RegionOptionalUnknown
InvalidMetadata(String)
MetadataGuidUnknown
MetadataRequiredMissing
MetadataRequiredUnknown
MetadataOptionalUnknown
MetadataReservedFlagsSet
MetadataEntryReservedNonzero
Metadata Table Entry Reserved field is not zero.
Standard: MS-VHDX-校验扩展标准 §4.4 — METADATA_ENTRY_RESERVED_NONZERO
FileParametersReservedFlags
FileParameters item reserved flags (bits 2-31) are set.
Standard: MS-VHDX-校验扩展标准 §4.4 — METADATA_FILE_PARAMETERS_RESERVED_FLAGS
InvalidParentLocator(String)
MetadataNotFound
LogReplayRequired
LogEntryCorrupted(String)
LogSequenceGap
LogSequenceGuidMismatch
LogActiveSequenceEmpty
BatEntryNotFound
BlockNotPresent
SectorOutOfBounds
ParentNotFound
ParentResolverRequired
ParentSectorSizeMismatch
ParentMismatch
ParentLocatorGuidMismatch
ParentLocatorMissingLinkage
ParentLocatorLinkage2Conflict
InvalidParameter(String)
ReadOnly
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Freeze for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.