pub enum ErrorKind {
Signal {
symbol: TempValue,
data: TempValue,
},
Throw {
tag: TempValue,
value: TempValue,
},
WrongTypeUserPtr {
expected: &'static str,
},
}
Expand description
Error types generic to all Rust dynamic modules.
This list is intended to grow over time and it is not recommended to exhaustively match against it.
Variants§
Signal
An error signaled by Lisp code.
Throw
A non-local exit thrown by Lisp code.
WrongTypeUserPtr
An error indicating that the given value is not a user-ptr
of the expected type.
§Examples:
#[defun]
fn wrap(x: i64) -> Result<RefCell<i64>> {
Ok(RefCell::new(x))
}
#[defun]
fn wrap_f(x: f64) -> Result<RefCell<f64>> {
Ok(RefCell::new(x))
}
#[defun]
fn unwrap(r: &RefCell<i64>) -> Result<i64> {
Ok(*r.try_borrow()?)
}
(unwrap 7) ; *** Eval error *** Wrong type argument: user-ptrp, 7
(unwrap (wrap 7)) ; 7
(unwrap (wrap-f 7)) ; *** Eval error *** Wrong type user-ptr: "expected: RefCell"
Trait Implementations§
source§impl Error for ErrorKind
impl Error for ErrorKind
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
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