Enum qoqo_calculator::CalculatorError
source · pub enum CalculatorError {
Show 16 variants
NotConvertable,
FloatSymbolicNotConvertable {
val: String,
},
ComplexSymbolicNotConvertable {
val: CalculatorComplex,
},
ComplexCanNotBeConvertedToFloat {
val: CalculatorComplex,
},
ParsingError {
msg: &'static str,
},
NotImplementedError {
fct: &'static str,
},
FunctionNotFound {
fct: String,
},
VariableNotSet {
name: String,
},
UnexpectedEndOfExpression,
DivisionByZero,
NoValueReturnedParsing,
NotEnoughFunctionArguments,
ForbiddenAssign {
variable_name: String,
},
NotParsableAssign {
variable_name: String,
},
NotParsableUnrecognized,
NotParsableSingleAssign,
}
Expand description
Define custom errors for Calculator.
Variants§
NotConvertable
An input cannot be converted to CalculatorFloat
FloatSymbolicNotConvertable
A symbolic input cannot be converted to CalculatorFloat
ComplexSymbolicNotConvertable
Fields
val: CalculatorComplex
Value that cannot be converted
A symbolic input cannot be converted to CalculatorComplex
ComplexCanNotBeConvertedToFloat
Fields
val: CalculatorComplex
Value of the CalculatorComplex that cannot be converted
A complex value cannot be converted to float because imaginary part is not zero
ParsingError
Parsing error when using Calculator
NotImplementedError
Function not implemented in Calculator
FunctionNotFound
Function not found in Calculator
VariableNotSet
A variable is not set
UnexpectedEndOfExpression
Parsed expression ended unexpectedly
DivisionByZero
Trying to divide by zero
NoValueReturnedParsing
A parsed value did not return a value.
NotEnoughFunctionArguments
Not enough function arguments provided in parsed expression.
ForbiddenAssign
Trying to assign variable in side-effect free parsing.
NotParsableAssign
Error raised when checking if a String-CalculatorFloat is valid and can be parsed
NotParsableUnrecognized
Error raised when checking if a String-CalculatorFloat is valid and can be parsed
NotParsableSingleAssign
Error raised when checking if a String-CalculatorFloat is valid and can be parsed
Trait Implementations§
source§impl Debug for CalculatorError
impl Debug for CalculatorError
source§impl Display for CalculatorError
impl Display for CalculatorError
source§impl Error for CalculatorError
impl Error for CalculatorError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
source§impl PartialEq for CalculatorError
impl PartialEq for CalculatorError
source§fn eq(&self, other: &CalculatorError) -> bool
fn eq(&self, other: &CalculatorError) -> bool
self
and other
values to be equal, and is used
by ==
.