pub struct Error(/* private fields */);Expand description
An error of the core. Boxed, so that Result<Handle, Error> is two
words and returns in registers on the interpreter’s hot path.
Implementations§
Source§impl Error
impl Error
Sourcepub fn unsupported(what: impl Into<String>) -> Self
pub fn unsupported(what: impl Into<String>) -> Self
An unsupported construct.
Sourcepub fn eval(what: impl Into<String>) -> Self
pub fn eval(what: impl Into<String>) -> Self
An unclassified evaluation error: the core has not established that TLC raises it, or with which class.
Sourcepub fn eval_class(tlc: TlcClass, what: impl Into<String>) -> Self
pub fn eval_class(tlc: TlcClass, what: impl Into<String>) -> Self
An evaluation error of TLC class tlc.
use dive_core::{Error, TlcClass};
let e = Error::eval_class(TlcClass::eval_exception(2179), "The second argument of \\div is 0.");
assert_eq!(e.tlc(), Some(TlcClass { code: 2179, eval_exception: true }));
assert_eq!(Error::eval("x").tlc(), None);Sourcepub fn tlc(&self) -> Option<TlcClass>
pub fn tlc(&self) -> Option<TlcClass>
TLC’s class of an evaluation error the core has classified.
Sourcepub fn into_parts(self) -> (ErrorKind, String)
pub fn into_parts(self) -> (ErrorKind, String)
The kind and the message.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
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()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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