Enum DeviceError
#[non_exhaustive]pub enum DeviceError {
Show 16 variants
PartitionTable(Error),
PartitionEntry {
line: String,
},
PartitionNotFound {
name: String,
},
Open {
path: PathBuf,
source: Error,
},
Info(Error),
Geometry {
size: u64,
block_size: u32,
page_size: u32,
},
BlockOutOfRange {
block: u32,
},
BufferLength {
len: usize,
},
BadBlockCheck {
block: u32,
source: Error,
},
MarkBad {
block: u32,
source: Error,
},
Erase {
block: u32,
source: Error,
},
Read {
block: u32,
source: Error,
},
Uncorrectable {
block: u32,
},
Write {
block: u32,
source: Error,
},
Verify {
block: u32,
},
NoSpace,
}Expand description
Failure of an MTD operation.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PartitionTable(Error)
Reading the partition table in /proc/mtd failed.
PartitionEntry
A line in /proc/mtd isn’t a valid partition entry.
PartitionNotFound
No MTD partition has the requested name.
Open
Opening a device file failed.
Info(Error)
Querying the geometry of the MTD device failed.
Geometry
The MTD device reports a geometry this crate can’t handle.
Fields
BlockOutOfRange
The block is beyond the end of the device.
BufferLength
A buffer exceeds a block, or a write buffer doesn’t end on a page.
BadBlockCheck
Checking a block for the bad block marker failed.
MarkBad
Marking a block bad failed.
Erase
Erasing a block failed.
Read
Reading a block failed.
Uncorrectable
A block contains bit errors that ECC can’t correct.
Write
Writing a block failed.
Verify
A block doesn’t contain the data that was written to it.
NoSpace
No good block is left on the device.
Implementations§
§impl DeviceError
impl DeviceError
pub(crate) fn is_media_failure(&self) -> bool
pub(crate) fn is_media_failure(&self) -> bool
Returns whether the error means that the block itself is failing.
Trait Implementations§
§impl Debug for DeviceError
impl Debug for DeviceError
§impl Display for DeviceError
impl Display for DeviceError
§impl Error for DeviceError
impl Error for DeviceError
§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()