#[non_exhaustive]pub enum AstError {
Core(AstCoreError),
NotFound {
node: NodeId,
},
WrongKind {
node: NodeId,
expected: NodeKind,
found: NodeKind,
},
DuplicateName {
scope: NodeId,
name: String,
},
Invariant(Vec<InvariantViolation>),
NotAnAggregate {
node: NodeId,
found: &'static str,
},
AlreadyComplete {
node: NodeId,
},
}Expand description
Failure of a model operation.
#[non_exhaustive] so that later phases can append variants —
invariant violations arrive with the edit surface — without that
being a breaking change.
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.
Core(AstCoreError)
Infrastructure failure.
NotFound
No node carries that identity.
WrongKind
The node exists but is not the kind the operation required.
Fields
DuplicateName
A name collided within its scope.
Invariant(Vec<InvariantViolation>)
A commit broke one or more structural invariants and was rolled back. The model is byte-identical to its state before the transaction began. Spec §8.1.
NotAnAggregate
A part was added to a type that does not hold that kind of part — an enumerator on a struct, a member on an enum.
AlreadyComplete
A type that already has a body was asked to receive one again. Two definitions of one name are a duplicate, not a completion.
Trait Implementations§
impl Eq for AstError
Source§impl Error for AstError
impl Error for AstError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<AstCoreError> for AstError
impl From<AstCoreError> for AstError
Source§fn from(error: AstCoreError) -> Self
fn from(error: AstCoreError) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for AstError
Auto Trait Implementations§
impl Freeze for AstError
impl RefUnwindSafe for AstError
impl Send for AstError
impl Sync for AstError
impl Unpin for AstError
impl UnsafeUnpin for AstError
impl UnwindSafe for AstError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more