Skip to main content

Error

Enum Error 

Source
pub enum Error {
Show 19 variants Io(Error), InvalidMbrSignature { found: [u8; 2], }, InvalidGptSignature { found: [u8; 8], }, GptHeaderCrcMismatch { expected: u32, actual: u32, }, GptEntriesCrcMismatch { expected: u32, actual: u32, }, BackupHeaderIo { lba: u64, source: Error, }, InvalidBackupGptSignature { found: [u8; 8], }, BackupGptHeaderCrcMismatch { expected: u32, actual: u32, }, PartitionOverlap { index1: usize, index2: usize, overlap_start: u64, overlap_end: u64, }, TooManyPartitions { max: usize, requested: usize, }, PartitionOutOfBounds { index: usize, partition_end: u64, disk_end: u64, }, InvalidPartitionEntrySize { size: u32, }, InvalidBlockSize { size: u32, minimum: u32, }, BackupHeaderMismatch, NoProtectiveMbr, InvalidHybridMbr { reason: &'static str, }, DiskTooSmall { required: u64, available: u64, }, FeatureNotAvailable(&'static str), MisalignedPartition { lba: u64, required_alignment: u64, },
}
Expand description

Errors that can occur during partition table operations.

Variants§

§

Io(Error)

An I/O error occurred.

§

InvalidMbrSignature

The MBR signature (0x55AA) is invalid.

Fields

§found: [u8; 2]

The actual signature bytes found.

§

InvalidGptSignature

The GPT signature (“EFI PART”) is invalid.

Fields

§found: [u8; 8]

The actual signature bytes found.

§

GptHeaderCrcMismatch

The GPT header CRC32 checksum does not match.

Fields

§expected: u32

The expected CRC32 value (from header).

§actual: u32

The actual CRC32 value (calculated).

§

GptEntriesCrcMismatch

The GPT partition entry array CRC32 checksum does not match.

Fields

§expected: u32

The expected CRC32 value (from header).

§actual: u32

The actual CRC32 value (calculated).

§

BackupHeaderIo

The backup GPT header could not be read from its declared LBA.

Fields

§lba: u64

LBA declared by the primary header for the backup header.

§source: Error

Underlying I/O failure.

§

InvalidBackupGptSignature

The backup GPT header signature is invalid.

Fields

§found: [u8; 8]

The actual signature bytes found.

§

BackupGptHeaderCrcMismatch

The backup GPT header CRC32 checksum does not match.

Fields

§expected: u32

The expected CRC32 value stored in the backup header.

§actual: u32

The calculated CRC32 value.

§

PartitionOverlap

Two partitions overlap.

Fields

§index1: usize

Index of the first overlapping partition.

§index2: usize

Index of the second overlapping partition.

§overlap_start: u64

Starting LBA of the overlap.

§overlap_end: u64

Ending LBA of the overlap.

§

TooManyPartitions

Too many partitions requested.

Fields

§max: usize

Maximum number of partitions allowed.

§requested: usize

Number of partitions requested.

§

PartitionOutOfBounds

A partition extends beyond the disk boundary.

Fields

§index: usize

Index of the offending partition.

§partition_end: u64

Ending LBA of the partition.

§disk_end: u64

Last usable LBA of the disk.

§

InvalidPartitionEntrySize

The partition entry size is invalid.

Fields

§size: u32

The invalid size.

§

InvalidBlockSize

A logical block is too small to contain the requested structure.

Fields

§size: u32

Supplied logical block size in bytes.

§minimum: u32

Minimum required size in bytes.

§

BackupHeaderMismatch

The backup GPT header does not match the primary.

§

NoProtectiveMbr

No protective MBR found on a GPT disk.

§

InvalidHybridMbr

Invalid hybrid MBR configuration.

Fields

§reason: &'static str

Description of the error.

§

DiskTooSmall

The disk is too small for the requested partitions.

Fields

§required: u64

Required size in sectors.

§available: u64

Available size in sectors.

§

FeatureNotAvailable(&'static str)

A required feature is not available.

§

MisalignedPartition

A partition is not properly aligned.

Fields

§lba: u64

The misaligned LBA.

§required_alignment: u64

The required alignment in sectors.

Trait Implementations§

Source§

impl Debug for Error

Source§

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

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

impl Display for Error

Source§

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

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

impl Error for Error

Available on crate feature std only.
Source§

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

Returns 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, request: &mut Request<'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<E: IoError> From<Error<E>> for Error

Source§

fn from(err: Error<E>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where 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<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

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

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.