#[non_exhaustive]pub enum EvalError {
UnknownVariable(String),
DivisionByZero,
UnknownFunction(String),
ArityMismatch {
name: String,
expected: usize,
got: usize,
},
NotAnInteger(f64),
Cycle(String),
NoLimit {
var: String,
provider: String,
limit: &'static str,
},
}Expand description
Error produced while evaluating a GenApi formula, or the nodes its variables read.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
UnknownVariable(String)
Variable referenced by the expression has no bound value.
DivisionByZero
Division by zero occurred.
UnknownFunction(String)
Unknown function name.
ArityMismatch
Wrong number of arguments to function.
Fields
NotAnInteger(f64)
An integer was needed and the result is not one: not finite, beyond
i64, or not whole.
Cycle(String)
A value depends on itself: through formula variables, <pValue>
delegation, or a predicate that reads the node it gates.
NoLimit
A variable reads the .Min, .Max or .Inc of a node that declares
none.
Trait Implementations§
Source§impl Error for EvalError
impl Error for EvalError
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 EvalError
Auto Trait Implementations§
impl Freeze for EvalError
impl RefUnwindSafe for EvalError
impl Send for EvalError
impl Sync for EvalError
impl Unpin for EvalError
impl UnsafeUnpin 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