Skip to main content

Error

Enum Error 

Source
pub enum Error<F: BackedFile, M: BackedManifest> {
    BadMagicText,
    BadExternalMagic {
        expected: u16,
        found: u16,
    },
    BadMagic {
        expected: u16,
        found: u16,
    },
    ChecksumMismatch,
    EntryTooLarge {
        len: u32,
        remaining: u32,
    },
    Data(<M::Data as Data>::Error),
    Manifest(M::Error),
    IO(F::Error),
}
Expand description

Errors for manifest file.

Variants§

§

BadMagicText

Manifest has bad magic.

§

BadExternalMagic

Cannot open manifest because the external magic doesn’t match.

Fields

§expected: u16

Expected external magic.

§found: u16

Found external magic.

§

BadMagic

Cannot open manifest because the magic doesn’t match.

Fields

§expected: u16

Expected magic.

§found: u16

Found magic.

§

ChecksumMismatch

Corrupted manifest file: entry checksum mismatch.

§

EntryTooLarge

Corrupted manifest file: not enough bytes to decode manifest entry.

Fields

§len: u32

Entry data len.

§remaining: u32

Remaining file size.

§

Data(<M::Data as Data>::Error)

Encode/decode data error.

§

Manifest(M::Error)

Manifest error.

§

IO(F::Error)

I/O error.

Implementations§

Source§

impl<F: BackedFile, M: BackedManifest> Error<F, M>

Source

pub const fn io(err: F::Error) -> Self

Create a new Error from an I/O error.

Source

pub const fn data(err: <M::Data as Data>::Error) -> Self

Create a new Error from a data error.

Source

pub const fn manifest(err: M::Error) -> Self

Create a new Error from an unknown manifest event.

Trait Implementations§

Source§

impl<F: Debug + BackedFile, M: Debug + BackedManifest> Debug for Error<F, M>
where M::Data: Debug, M::Error: Debug, F::Error: Debug,

Source§

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

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

impl<F: BackedFile, M: BackedManifest> Display for Error<F, M>

Source§

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

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

impl<F: BackedFile, M: BackedManifest> Error for Error<F, M>
where Self: Debug + Display,

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<F, M> Freeze for Error<F, M>

§

impl<F, M> RefUnwindSafe for Error<F, M>

§

impl<F, M> Send for Error<F, M>
where <<M as BackedManifest>::Data as Data>::Error: Send, <M as BackedManifest>::Error: Send, <F as BackedFile>::Error: Send,

§

impl<F, M> Sync for Error<F, M>
where <<M as BackedManifest>::Data as Data>::Error: Sync, <M as BackedManifest>::Error: Sync, <F as BackedFile>::Error: Sync,

§

impl<F, M> Unpin for Error<F, M>
where <<M as BackedManifest>::Data as Data>::Error: Unpin, <M as BackedManifest>::Error: Unpin, <F as BackedFile>::Error: Unpin,

§

impl<F, M> UnsafeUnpin for Error<F, M>

§

impl<F, M> UnwindSafe for Error<F, M>

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.