pub trait Evaluatable {
// Required method
fn eval(
&self,
shell: &mut Shell<impl ShellExtensions>,
) -> Result<i64, EvalError>;
}Expand description
Trait implemented by evaluatable arithmetic expressions.
Required Methods§
Sourcefn eval(
&self,
shell: &mut Shell<impl ShellExtensions>,
) -> Result<i64, EvalError>
fn eval( &self, shell: &mut Shell<impl ShellExtensions>, ) -> Result<i64, EvalError>
Evaluate the given arithmetic expression, returning the resulting numeric value.
§Arguments
shell- The shell to use for evaluation.
§Errors
EvalError::DivideByZeroon division or remainder by zero.EvalError::NegativeExponenton a negative exponent.EvalError::RecursionLimitExceededwhen variable references nest too deeply.EvalError::ExpandingUnsetVariablewhen an unset variable is referenced underset -u.EvalError::FailedToAccessArrayorEvalError::FailedToUpdateEnvironmentwhen an array element or variable cannot be read or assigned.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".