pub enum BandMathError {
UnexpectedToken {
pos: usize,
found: String,
},
UnknownFunction(String),
InvalidBandIndex(u32),
WrongArgCount {
function: String,
expected: usize,
actual: usize,
},
DivByConstantZero,
TrailingTokens(usize),
EmptyExpression,
UnmatchedParen,
InvalidNumber {
pos: usize,
text: String,
},
}Expand description
Errors produced while lexing/parsing a band-math expression.
Variants§
UnexpectedToken
Encountered a character or token that wasn’t expected at this position.
Fields
UnknownFunction(String)
Identifier used like a function (name(...)) is not a known builtin.
InvalidBandIndex(u32)
Bn band reference is outside the allowed inclusive range 1..=999.
The wrapped value is the raw integer that was parsed, or 0 for B0.
WrongArgCount
Function call had the wrong number of arguments.
Fields
DivByConstantZero
Detected literal / 0 or / 0.0 at parse time.
TrailingTokens(usize)
Parser stopped before consuming the entire token stream.
EmptyExpression
Input string was empty or contained only whitespace.
UnmatchedParen
( without a matching ) (or vice-versa).
InvalidNumber
Number literal failed to parse as f32.
Trait Implementations§
Source§impl Clone for BandMathError
impl Clone for BandMathError
Source§fn clone(&self) -> BandMathError
fn clone(&self) -> BandMathError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BandMathError
impl Debug for BandMathError
Source§impl Display for BandMathError
impl Display for BandMathError
Source§impl Error for BandMathError
impl Error for BandMathError
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()
Source§impl PartialEq for BandMathError
impl PartialEq for BandMathError
Source§fn eq(&self, other: &BandMathError) -> bool
fn eq(&self, other: &BandMathError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BandMathError
Auto Trait Implementations§
impl Freeze for BandMathError
impl RefUnwindSafe for BandMathError
impl Send for BandMathError
impl Sync for BandMathError
impl Unpin for BandMathError
impl UnsafeUnpin for BandMathError
impl UnwindSafe for BandMathError
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