pub struct EvalError {
pub kind: ErrorKind,
pub message: ErrorMessage,
pub expr: ArenaIndex,
pub expected: Option<&'static str>,
pub got: Option<&'static str>,
pub expected_args: Option<usize>,
pub got_args: Option<usize>,
pub backtrace: [StackFrame; 16],
pub backtrace_len: usize,
pub parse_error: Option<ParseError>,
}Expand description
Evaluation error with context
Fields§
§kind: ErrorKindWhat kind of error
message: ErrorMessageHuman-readable message context
expr: ArenaIndexThe expression that caused the error
expected: Option<&'static str>Expected type (for type errors)
got: Option<&'static str>Got type (for type errors)
expected_args: Option<usize>Expected argument count
got_args: Option<usize>Got argument count
backtrace: [StackFrame; 16]Call stack backtrace
backtrace_len: usize§parse_error: Option<ParseError>Original parse error (if applicable)
Implementations§
Source§impl EvalError
impl EvalError
pub fn new(kind: ErrorKind) -> Self
pub fn with_expr(self, expr: ArenaIndex) -> Self
pub fn with_message(self, msg: &str) -> Self
pub fn with_types(self, expected: &'static str, got: &'static str) -> Self
pub fn with_args(self, expected: usize, got: usize) -> Self
pub fn with_backtrace(self, stack: &[StackFrame], len: usize) -> Self
Source§impl EvalError
impl EvalError
Sourcepub fn from_parse_error(e: ParseError, expr: ArenaIndex) -> Self
pub fn from_parse_error(e: ParseError, expr: ArenaIndex) -> Self
Create an EvalError from a ParseError with expression context
Trait Implementations§
Source§impl From<ArenaError> for EvalError
impl From<ArenaError> for EvalError
Source§fn from(e: ArenaError) -> Self
fn from(e: ArenaError) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for EvalError
impl From<ParseError> for EvalError
Source§fn from(e: ParseError) -> Self
fn from(e: ParseError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for EvalError
impl RefUnwindSafe for EvalError
impl Send for EvalError
impl Sync for EvalError
impl Unpin for EvalError
impl UnwindSafe for EvalError
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