#[non_exhaustive]pub enum NotationError {
InvalidFormat,
InvalidNumber(ParseIntError),
Zero(&'static str),
InvalidOperator,
NumberTooLarge(u32),
}Expand description
An error from parsing or constructing dice notation.
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.
InvalidFormat
The input doesn’t match the XdY?Z notation format.
InvalidNumber(ParseIntError)
A number in the input couldn’t be parsed, usually because it’s
too large for a u32.
Zero(&'static str)
A value that must be positive was zero. Holds the name of the
value: "count", "sides" or "divisor".
InvalidOperator
The operator isn’t one of +, -, * or /.
NumberTooLarge(u32)
A value exceeded the maximum. Holds the maximum,
MAX_VALUE.
Trait Implementations§
Source§impl Debug for NotationError
impl Debug for NotationError
Source§impl Display for NotationError
impl Display for NotationError
Source§impl Error for NotationError
impl Error for NotationError
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 From<ParseIntError> for NotationError
impl From<ParseIntError> for NotationError
Source§fn from(source: ParseIntError) -> Self
fn from(source: ParseIntError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for NotationError
impl PartialEq for NotationError
impl StructuralPartialEq for NotationError
Auto Trait Implementations§
impl Freeze for NotationError
impl RefUnwindSafe for NotationError
impl Send for NotationError
impl Sync for NotationError
impl Unpin for NotationError
impl UnsafeUnpin for NotationError
impl UnwindSafe for NotationError
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