Skip to main content

FlashError

Enum FlashError 

Source
#[non_exhaustive]
pub enum FlashError<E> { Entry(Error<E>), Transfer { offset: usize, length: usize, source: Error<E>, }, Fault { stage: Stage, sense: Triplet, }, ReadyTimeout(Error<E>), Startup(StartupError<E>), Mismatch { address: usize, read: u8, wrote: u8, differing: usize, checked: usize, }, Incomplete { unverified: usize, checked: usize, }, }
Expand description

A failed flash. Every variant after FlashError::Entry may leave the drive holding partial or unverified firmware; nothing is retried or rolled back.

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

Entry(Error<E>)

PROBE, TEST UNIT READY or PREPARE failed; no firmware data was sent. If PREPARE was reached the drive may be in update mode.

§

Transfer

A STREAM write failed.

Fields

§offset: usize

Offset of the failed chunk.

§length: usize

Its length.

§source: Error<E>

The command failure.

§

Fault

REQUEST SENSE reported a programming failure.

Fields

§stage: Stage

When the sense was read.

§sense: Triplet

The sense.

§

ReadyTimeout(Error<E>)

The drive did not answer TEST UNIT READY within crate::DriveClass::ready_timeout; the last poll’s error.

§

Startup(StartupError<E>)

Readiness/read-back completed, but the selected target was not confirmed running.

§

Mismatch

A protected byte read back differently.

Fields

§address: usize

Offset of the first differing byte.

§read: u8

The byte read back.

§wrote: u8

The byte written.

§differing: usize

Protected bytes that differ.

§checked: usize

Protected bytes compared.

§

Incomplete

Chunks holding protected bytes could not be read back.

Fields

§unverified: usize

Chunks not verified.

§checked: usize

Protected bytes compared, all equal.

Trait Implementations§

Source§

impl<E> CodedError for FlashError<E>

Available on crate features drive and image only.
Source§

fn code(&self) -> &'static str

Stable identifier, such as mediatek.receiver.changed.
Source§

impl<E: Debug> Debug for FlashError<E>

Source§

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

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

impl<E: Debug> Display for FlashError<E>

Source§

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

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

impl<E: Debug + 'static> Error for FlashError<E>

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

Auto Trait Implementations§

§

impl<E> Freeze for FlashError<E>

§

impl<E> RefUnwindSafe for FlashError<E>

§

impl<E> Send for FlashError<E>
where Error<E>: Send, StartupError<E>: Send,

§

impl<E> Sync for FlashError<E>
where Error<E>: Sync, StartupError<E>: Sync,

§

impl<E> Unpin for FlashError<E>
where Error<E>: Unpin, StartupError<E>: Unpin,

§

impl<E> UnsafeUnpin for FlashError<E>

§

impl<E> UnwindSafe for FlashError<E>

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> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.