pub enum DeclaredError {
Rich {
ty: Path,
code: Option<LitStr>,
},
Canned {
message: LitStr,
code: Option<LitStr>,
},
}Expand description
The error(…) word’s two legal shapes, each optionally headed by a code.
type and message are MUTUALLY EXCLUSIVE, so they are two arms rather than two options: a
declaration that wrote both is refused by the grammar, and a model that could hold both would be
a shape the refusal exists to make unreachable.
Variants§
Rich
error(type = "…") — the failure is a type the application owns.
Fields
Canned
error(message = "…") — the whole failure is the declaration’s own sentence.
Trait Implementations§
Source§impl Clone for DeclaredError
impl Clone for DeclaredError
Auto Trait Implementations§
impl !Send for DeclaredError
impl !Sync for DeclaredError
impl Freeze for DeclaredError
impl RefUnwindSafe for DeclaredError
impl Unpin for DeclaredError
impl UnsafeUnpin for DeclaredError
impl UnwindSafe for DeclaredError
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