Skip to main content

ErrorCode

Enum ErrorCode 

Source
pub enum ErrorCode {
Show 27 variants E001, E002, E003, E004, E005, E006, E100, E101, E200, E201, E202, E203, E204, E300, E301, E302, E303, E304, E305, E306, E307, E308, E309, E400, E401, E402, E403,
}
Expand description

Error codes for categorizing diagnostic errors.

Variants§

§

E001

Unterminated string literal.

A string was opened with a quote but never closed.

§

E002

Unexpected character.

A character was encountered that is not valid in this context.

§

E003

Invalid escape sequence.

An unrecognized escape sequence was used in a string literal. Valid escapes are: \n, \r, \t, \b, \f, \\, \/, \', \", \0, \u{...}.

§

E004

Invalid unicode escape format.

A unicode escape sequence was malformed. Unicode escapes must use the format \u{XXXX} with 1-6 hexadecimal digits.

§

E005

Invalid unicode codepoint.

The unicode codepoint is out of range or in the surrogate range. Valid codepoints are 0x0000-0xD7FF and 0xE000-0x10FFFF.

§

E006

Empty unicode escape.

A unicode escape \u{} was found with no hexadecimal digits.

§

E100

Unexpected token.

The parser encountered a token it did not expect at this position.

§

E101

Incomplete input.

The input ended unexpectedly before a complete construct was parsed.

§

E200

Undefined component reference.

A component was referenced that has not been defined.

§

E201

Unpaired activate statement.

An activate statement has no matching deactivate.

§

E202

Unpaired deactivate statement.

A deactivate statement has no matching activate.

§

E203

Invalid align value for diagram type.

The specified alignment is not valid for this diagram type.

§

E204

Unknown embed reference.

An embed <name> references an identifier that doesn’t match any namespaced import in the current file.

§

E300

Undefined type reference.

A type was referenced that has not been defined.

§

E301

Type override not supported.

Overriding is not supported for this type.

§

E302

Invalid attribute value.

An attribute value is not valid for the expected type.

§

E303

Unknown attribute.

An attribute was specified that is not recognized.

§

E304

Unsupported attribute for shape/type.

The attribute is valid but not supported for this particular shape or type.

§

E305

Nested diagram not allowed.

A diagram definition was found inside another diagram.

§

E306

Invalid diagram structure.

The diagram structure is invalid or malformed.

§

E307

Type mismatch.

A type was used in a context where a different kind of type was expected (e.g., using an Arrow type where a Shape type is required).

§

E308

Shape does not support nested content.

An attempt was made to add nested content to a shape type that does not support it.

§

E309

Unresolved embed reference.

An embed <name> references a diagram that could not be resolved.

§

E400

File not found.

A source file referenced by an import declaration or passed as the root entry point could not be resolved or read.

§

E401

Circular dependency.

A file appears in its own import chain, forming a cycle.

§

E402

Invalid import path.

An import path is malformed (e.g., empty).

§

E403

Invalid namespace derivation.

A namespace identifier could not be derived from the import path (e.g., the path has no file stem or contains non-UTF-8 components).

Implementations§

Source§

impl ErrorCode

Source

pub fn as_str(&self) -> &'static str

Returns the numeric code as a string (e.g., “E001”).

Source

pub fn description(&self) -> &'static str

Returns a short description of what this error code means.

Trait Implementations§

Source§

impl Clone for ErrorCode

Source§

fn clone(&self) -> ErrorCode

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 ErrorCode

Source§

impl Debug for ErrorCode

Source§

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

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

impl Display for ErrorCode

Source§

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

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

impl Eq for ErrorCode

Source§

impl Hash for ErrorCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ErrorCode

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ErrorCode

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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> 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> ToSmolStr for T
where T: Display + ?Sized,

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.