Skip to main content

Error

Enum Error 

Source
#[non_exhaustive]
pub enum Error {
Show 18 variants Io(Error), NotRiff { found: [u8; 4], }, TruncatedHeader { offset: u64, available: u64, }, Truncated { id: Fourcc, declared: u64, available: u64, }, ChildExceedsParent { id: Fourcc, declared: u64, remaining: u64, }, MissingPad { id: Fourcc, offset: u64, }, ListTooShort { id: Fourcc, size: u64, }, TooDeep { max: usize, }, MissingDs64 { found: Fourcc, }, BadDs64 { size: u64, }, UnresolvedSize { id: Fourcc, }, NotAList { id: Fourcc, }, NotInList, NoOpenChunk, BufferTooSmall { needed: u64, }, TooLarge { size: u64, }, Unbalanced { open: usize, }, Unsupported(Feature),
}
Expand description

An error from parsing, streaming, or writing a container.

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

Io(Error)

The underlying stream returned an error.

§

NotRiff

The first four bytes do not identify a supported form.

Fields

§found: [u8; 4]

The form bytes found in the input.

§

TruncatedHeader

Fewer than eight bytes remain for a chunk header, or fewer than twelve bytes remain for the file header.

Fields

§offset: u64

Absolute offset of the incomplete header.

§available: u64

Bytes available from the offset.

§

Truncated

A chunk payload ends before its declared size.

Fields

§id: Fourcc

Identifier of the incomplete chunk.

§declared: u64

Declared payload size.

§available: u64

Payload bytes available in the input.

§

ChildExceedsParent

A child chunk extends beyond its list.

Fields

§id: Fourcc

Identifier of the child chunk.

§declared: u64

Declared child payload size.

§remaining: u64

Bytes left in the list from the child header.

§

MissingPad

An odd payload reaches the input end without a pad byte.

Fields

§id: Fourcc

Identifier of the unpadded chunk.

§offset: u64

Absolute offset where the pad byte belongs.

§

ListTooShort

A list payload has no complete four-byte list type.

Fields

§id: Fourcc

Identifier of the list chunk.

§size: u64

Declared list payload size.

§

TooDeep

List nesting reached the fixed limit.

Fields

§max: usize

Maximum supported nesting depth.

§

MissingDs64

An RF64 or BW64 file does not start with a size table.

Fields

§found: Fourcc

Identifier of the first chunk.

§

BadDs64

The RF64 size table is too short for its declared entries.

Fields

§size: u64

Declared size of the table payload.

§

UnresolvedSize

A sentinel size has no matching 64-bit value.

Fields

§id: Fourcc

Identifier whose size could not be resolved.

§

NotAList

A list-only operation received another chunk type.

Fields

§id: Fourcc

Identifier of the current chunk.

§

NotInList

A list-leave operation was requested at the top level.

§

NoOpenChunk

A streaming write was requested without an open chunk.

§

BufferTooSmall

The caller’s payload buffer cannot hold the remaining bytes.

Fields

§needed: u64

Required buffer length.

§

TooLarge

A size cannot fit in a 32-bit container field.

Fields

§size: u64

Size that exceeded the field.

§

Unbalanced

The writer has open chunks or lists.

Fields

§open: usize

Number of open scopes.

§

Unsupported(Feature)

The requested feature is unavailable.

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, formatter: &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 From<Error> for Error

Available on crate feature std only.
Source§

fn from(error: Error) -> Self

Converts to this type from the input type.

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

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.