Skip to main content

ImageError

Enum ImageError 

#[non_exhaustive]
pub enum ImageError<E> { Size(E), Read { block: u32, source: E, }, PartialBlock { block: u32, len: usize, }, Header { block: u32, source: FormatError, }, Offsets { vid_header_offset: u32, data_offset: u32, block_size: usize, }, TooManyBlocks, BufferLength { len: usize, needed: usize, }, NoVolumeTable, VolumeTable { lnum: u32, source: FormatError, }, DuplicateBlock { first: u32, second: u32, }, MissingBlock { lnum: u32, }, UpdateMarker, }
Expand description

Failure to read a UBI image whose source fails with E.

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

Size(E)

Reading the size of the image failed.

§

Read

Reading a block failed.

Fields

§block: u32

The index of the block.

§source: E

The error of the source.

§

PartialBlock

The image ends in the middle of a block.

Fields

§block: u32

The index of the block.

§len: usize

The bytes of the block in the image.

§

Header

A block of the image has an invalid header.

Fields

§block: u32

The index of the block.

§source: FormatError

The error of the header.

§

Offsets

The header offsets don’t fit the block, or no minimum I/O size gives this data offset.

Fields

§vid_header_offset: u32

The offset of the volume identifier header.

§data_offset: u32

The offset of the data.

§block_size: usize

The size of the block.

§

TooManyBlocks

The image has more blocks than fit into a u32.

§

BufferLength

A buffer or block map has the wrong length.

Fields

§len: usize

The length of the buffer.

§needed: usize

The length that the buffer needs.

§

NoVolumeTable

The image holds data, but no volume table.

§

VolumeTable

Neither copy of the volume table is valid.

Fields

§lnum: u32

The logical eraseblock of the last copy that was checked.

§source: FormatError

The error of that copy.

§

DuplicateBlock

Blocks with the same logical eraseblock have the same sequence number.

Fields

§first: u32

The index of the first block.

§second: u32

The index of the second block.

§

MissingBlock

A static volume misses a logical eraseblock.

Fields

§lnum: u32

The number of the logical eraseblock.

§

UpdateMarker

The volume has an update that didn’t finish. The kernel refuses to read it.

Trait Implementations§

§

impl<E: Debug> Debug for ImageError<E>

§

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

Formats the value using the given formatter. Read more
§

impl<E> Display for ImageError<E>

§

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

Formats the value using the given formatter. Read more
§

impl<E> Error for ImageError<E>
where E: Error + 'static, Self: Debug + Display,

§

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 ImageError<E>
where E: Freeze,

§

impl<E> RefUnwindSafe for ImageError<E>
where E: RefUnwindSafe,

§

impl<E> Send for ImageError<E>
where E: Send,

§

impl<E> Sync for ImageError<E>
where E: Sync,

§

impl<E> Unpin for ImageError<E>
where E: Unpin,

§

impl<E> UnsafeUnpin for ImageError<E>
where E: UnsafeUnpin,

§

impl<E> UnwindSafe for ImageError<E>
where E: UnwindSafe,

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 = !

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.