Skip to main content

ParseError

Enum ParseError 

Source
pub enum ParseError {
Show 23 variants Toml(Error), DimensionTooLarge(usize), EmptySignature, DuplicateBasisName(String), InvalidBasisName { name: String, }, BasisIndexOutOfBounds { name: String, index: usize, dim: usize, }, NonContiguousBasisIndices { expected: usize, found: usize, name: String, }, InvalidGrade { type_name: String, grade: usize, max: usize, }, FieldCountMismatch { type_name: String, expected: usize, got: usize, }, DuplicateFieldName { type_name: String, field: String, }, DuplicateTypeName(String), InvalidBladeName { name: String, }, BladeIndexOutOfBounds { name: String, index: usize, dim: usize, }, UnknownType(String), SelfAlias { type_name: String, }, AliasCycle { type_name: String, }, UnknownFieldName { type_name: String, field: String, }, InvalidValue { field: String, value: String, expected: String, }, SparseBladeCountMismatch { type_name: String, blades: usize, fields: usize, }, SparseBladeGradeMismatch { type_name: String, blade: String, blade_grade: usize, grades: Vec<usize>, }, IncompleteAlgebra { name: String, count: usize, details: String, }, MissingFieldMap { type_name: String, }, FieldMapGradeMismatch { type_name: String, field: String, blade: String, blade_grade: usize, grades: Vec<usize>, },
}
Expand description

Errors that can occur when parsing an algebra specification.

Variants§

§

Toml(Error)

TOML syntax error.

§

DimensionTooLarge(usize)

Algebra dimension exceeds the maximum supported (6).

§

EmptySignature

Signature must have at least one basis vector.

§

DuplicateBasisName(String)

Duplicate basis vector name in signature.

§

InvalidBasisName

Invalid basis vector name in signature.

Fields

§name: String

The invalid basis name.

§

BasisIndexOutOfBounds

Basis vector index exceeds algebra dimension.

Fields

§name: String

The basis name.

§index: usize

The invalid index (1-based from name).

§dim: usize

Algebra dimension.

§

NonContiguousBasisIndices

Basis vector indices are not contiguous (0, 1, 2, …).

Fields

§expected: usize

The expected index.

§found: usize

The found index.

§name: String

The basis name with the wrong index.

§

InvalidGrade

Type references a grade that exceeds the algebra dimension.

Fields

§type_name: String

The type name.

§grade: usize

The invalid grade.

§max: usize

Maximum valid grade.

§

FieldCountMismatch

Type has wrong number of fields for its grades.

Fields

§type_name: String

The type name.

§expected: usize

Expected number of fields.

§got: usize

Actual number of fields.

§

DuplicateFieldName

Duplicate field name in a type.

Fields

§type_name: String

The type name.

§field: String

The duplicate field name.

§

DuplicateTypeName(String)

Duplicate type name in specification.

§

InvalidBladeName

Invalid blade name in blades section.

Fields

§name: String

The invalid blade name.

§

BladeIndexOutOfBounds

Blade index exceeds algebra dimension.

Fields

§name: String

The blade name.

§index: usize

The invalid index.

§dim: usize

Algebra dimension.

§

UnknownType(String)

Unknown type reference (e.g., in alias_of).

§

SelfAlias

Type alias references itself.

Fields

§type_name: String

The type name.

§

AliasCycle

Type alias forms a cycle.

Fields

§type_name: String

The type name.

§

UnknownFieldName

Unknown field name in a type’s field list.

Fields

§type_name: String

The type name.

§field: String

The unknown field name.

§

InvalidValue

Invalid value for a configuration field.

Fields

§field: String

The field name.

§value: String

The invalid value.

§expected: String

Description of expected values.

§

SparseBladeCountMismatch

Sparse type blade count doesn’t match field count.

Fields

§type_name: String

The type name.

§blades: usize

Number of blade mappings.

§fields: usize

Number of fields.

§

SparseBladeGradeMismatch

Sparse type blade doesn’t match specified grades.

Fields

§type_name: String

The type name.

§blade: String

The blade name.

§blade_grade: usize

The blade’s actual grade.

§grades: Vec<usize>

The expected grades.

§

IncompleteAlgebra

Algebra is incomplete: some products don’t have matching output types.

Fields

§name: String

Algebra name.

§count: usize

Number of missing products.

§details: String

Human-readable details of missing products.

§

MissingFieldMap

Type is missing required field_map.

Fields

§type_name: String

The type name.

§

FieldMapGradeMismatch

Blade grade in field_map doesn’t match type’s grades.

Fields

§type_name: String

The type name.

§field: String

The field name.

§blade: String

The blade name.

§blade_grade: usize

The blade’s actual grade.

§grades: Vec<usize>

The expected grades.

Trait Implementations§

Source§

impl Debug for ParseError

Source§

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

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

impl Display for ParseError

Source§

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

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

impl Error for ParseError

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 ParseError

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.