Skip to main content

Mismatch

Enum Mismatch 

Source
#[non_exhaustive]
pub enum Mismatch { Primitive { expected: &'static str, actual: &'static str, }, EnumMember { member: String, declared: Vec<String>, }, SelectMember { written: String, select: String, }, FixedWidth { expected: usize, actual: usize, }, ExpectedReference { declared: String, actual: &'static str, }, TypedOutsideSelect { written: String, declared: String, }, TypedWrongType { written: String, declared: String, }, UntypedSelectValue { select: String, actual: &'static str, }, }
Expand description

Why a value does not fit its declared type.

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

Primitive

The written form is not what the primitive accepts.

Fields

§expected: &'static str

What the schema expects, in words.

§actual: &'static str

What the file wrote, in words.

§

EnumMember

An enumeration constant the schema does not declare.

Fields

§member: String

The constant as written.

§declared: Vec<String>

The members the schema declares.

§

SelectMember

A typed value whose type is not a member of the declared SELECT.

Fields

§written: String

The wrapper type as written.

§select: String

The SELECT it had to belong to.

§

FixedWidth

A STRING(n) FIXED value written at the wrong width.

Fields

§expected: usize

The width the schema fixes.

§actual: usize

The width actually written.

§

ExpectedReference

A value that is not an entity reference, in a slot only an entity reference can fill: an entity-typed slot, or a SELECT of entities.

Fields

§declared: String

The entity or SELECT the slot declares.

§actual: &'static str

What the file wrote, in words.

§

TypedOutsideSelect

A typed parameter of the declared type, or of a specialisation of it, where the declared type is not a SELECT. ISO 10303-21:2016 §12.1.6 writes such a value bare.

Fields

§written: String

The wrapper type as written.

§declared: String

The non-SELECT type the slot declares.

§

TypedWrongType

A typed parameter whose type is not the declared non-SELECT type: the wrong form and the wrong type.

Fields

§written: String

The wrapper type as written.

§declared: String

The non-SELECT type the slot declares.

§

UntypedSelectValue

A bare value where the declared type is a SELECT. ISO 10303-21:2016 §12.1.8 writes every value of a SELECT that is not an entity instance as a typed parameter naming its type.

Fields

§select: String

The SELECT the slot declares.

§actual: &'static str

What the file wrote, in words.

Trait Implementations§

Source§

impl Clone for Mismatch

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 Debug for Mismatch

Source§

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

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

impl Eq for Mismatch

Source§

impl PartialEq for Mismatch

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 Mismatch

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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