Enum math_parse::MathParseErrors
source · pub enum MathParseErrors {
UnclosedParenthesis,
UnopenedParenthesis,
EmptyLine,
InvalidNumber(String),
MisplacedOperator(char),
TrailingOperator,
IntConversion(f64),
BinaryOpOnFloat(f64, char),
ReturnFloatExpectedInt(f64),
MathParseInternalBug(String),
}Expand description
Type used to represent any errors that can happen in the parsing of a math expression.
Variants§
UnclosedParenthesis
A parenthesis was opened but never closed.
UnopenedParenthesis
A closing parenthesis was used with no matching open parenthesis.
EmptyLine
The math expression is empty. Or the right hand side of an operator is empty.
InvalidNumber(String)
An expression that should have been a number but can’t be read.
MisplacedOperator(char)
An operator is not where it should be. Like a “*” after a “+”, or the left hand side of an operator being empty.
TrailingOperator
An operator is the last element of a line of math.
IntConversion(f64)
A float could not be converted to an int.
BinaryOpOnFloat(f64, char)
A binary operation have been tried on a float.
ReturnFloatExpectedInt(f64)
We wanted to return an int but we got a float instead.
MathParseInternalBug(String)
This error should never be raised and should be reported to the library’s maintainer.
Trait Implementations§
source§impl Debug for MathParseErrors
impl Debug for MathParseErrors
source§impl Display for MathParseErrors
impl Display for MathParseErrors
source§impl PartialEq for MathParseErrors
impl PartialEq for MathParseErrors
source§fn eq(&self, other: &MathParseErrors) -> bool
fn eq(&self, other: &MathParseErrors) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl StructuralPartialEq for MathParseErrors
Auto Trait Implementations§
impl RefUnwindSafe for MathParseErrors
impl Send for MathParseErrors
impl Sync for MathParseErrors
impl Unpin for MathParseErrors
impl UnwindSafe for MathParseErrors
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