Skip to main content

FileProblem

Enum FileProblem 

Source
#[non_exhaustive]
pub enum FileProblem {
Show 16 variants OutOfRange { got: u64, min: u64, max: u64, bound: Bound, }, NotInSet { got: u64, allowed: AllowedSet, bound: Bound, }, NotRequiredValue { got: u64, required: u64, bound: Bound, }, Disagrees { got: u64, expected: u64, with: FileField, }, DigestMismatch { got: u64, hash: HashAlgorithm, }, Truncated { have: u64, need: u64, }, OutOfBounds { offset: u64, len: u64, end: u64, }, Unreadable { offset: u64, }, Missing, Duplicate, Overlaps, Unterminated, FlagClear, BadSignature, OutOfOrder { after_record: u16, }, Unrecognized { got: u64, },
}
Available on crate feature crypto-ops only.
Expand description

What Error::BadParameters, Error::InvariantViolated and Error::UnsupportedAlgorithm carry: closed enums and integers, never text the file chose. Exported for the same reason as the two above: a caller matches on them. What Error::BadParameters, Error::InvariantViolated and Error::UnsupportedAlgorithm carry: closed enums and integers, never text the file chose. Exported for the same reason as the two above: a caller matches on them. What Error::BadParameters, Error::InvariantViolated and Error::UnsupportedAlgorithm carry: closed enums and integers, never text the file chose. Exported for the same reason as the two above: a caller matches on them. What is wrong with a FileField. Integers and closed enums only.

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

OutOfRange

Outside an inclusive range.

Fields

§got: u64

The value the file declares.

§min: u64

Inclusive floor.

§max: u64

Inclusive ceiling.

§bound: Bound

Whose range it is.

§

NotInSet

Not one of a closed set of values.

Fields

§got: u64

The value the file declares.

§allowed: AllowedSet

The values allowed.

§bound: Bound

Whose set it is.

§

NotRequiredValue

Not the one value allowed.

Fields

§got: u64

The value the file declares.

§required: u64

The value required.

§bound: Bound

Whose requirement it is.

§

Disagrees

Disagrees with another value the file declares or holds.

Fields

§got: u64

The value of this field.

§expected: u64

What the other field implies it must be.

§with: FileField

The other field.

§

DigestMismatch

A length or bit count the named hash cannot produce or take.

Fields

§got: u64

The value the file declares.

§hash: HashAlgorithm

The hash the file names.

§

Truncated

Fewer bytes than the structure needs.

Fields

§have: u64

The bytes there are.

§need: u64

The bytes it needs.

§

OutOfBounds

An extent runs past the end of what holds it.

Fields

§offset: u64

Where it starts.

§len: u64

How long it is.

§end: u64

Where what holds it ends.

§

Unreadable

Cannot be read where it starts: no whole header, or a length past the end.

Fields

§offset: u64

Where it starts.

§

Missing

Required and absent.

§

Duplicate

Present more than once where the format allows one.

§

Overlaps

Overlaps another extent.

§

Unterminated

A string that is not terminated.

§

FlagClear

A flag the format requires is clear.

§

BadSignature

A signature or identifier is not the format’s.

§

OutOfOrder

In the wrong place in a sequence.

Fields

§after_record: u16

The record it follows.

§

Unrecognized

A value the format does not define.

Fields

§got: u64

The value the file declares.

Trait Implementations§

Source§

impl Clone for FileProblem

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FileProblem

Source§

impl Debug for FileProblem

Source§

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

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

impl Display for FileProblem

Source§

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

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

impl Eq for FileProblem

Source§

impl PartialEq for FileProblem

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FileProblem

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.