pub struct ExpressionError<'s> { /* private fields */ }Expand description
An error that occurs during evaluation.
Printing this error will show the error message and the location in the source code.
use somni_expr::{Context, TypeSet32};
let mut ctx = Context::<TypeSet32>::new_with_types();
let error = ctx.evaluate::<u32>("true + 1").unwrap_err();
println!("{error:?}");
// Output:
//
// Evaluation error
// ---> at line 1 column 1
// |
// 1 | true + 1
// | ^^^^^^^^ Failed to evaluate expression: Type errorImplementations§
Source§impl ExpressionError<'_>
impl ExpressionError<'_>
Sourcepub fn into_inner(self) -> EvalError
pub fn into_inner(self) -> EvalError
Returns the inner EvalError.
Trait Implementations§
Source§impl<'s> Clone for ExpressionError<'s>
impl<'s> Clone for ExpressionError<'s>
Source§fn clone(&self) -> ExpressionError<'s>
fn clone(&self) -> ExpressionError<'s>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExpressionError<'_>
impl Debug for ExpressionError<'_>
Source§impl<'s> PartialEq for ExpressionError<'s>
impl<'s> PartialEq for ExpressionError<'s>
impl<'s> StructuralPartialEq for ExpressionError<'s>
Auto Trait Implementations§
impl<'s> Freeze for ExpressionError<'s>
impl<'s> RefUnwindSafe for ExpressionError<'s>
impl<'s> Send for ExpressionError<'s>
impl<'s> Sync for ExpressionError<'s>
impl<'s> Unpin for ExpressionError<'s>
impl<'s> UnwindSafe for ExpressionError<'s>
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