Enum knightrs::Error [−][src]
pub enum Error { DivisionByZero { kind: &'static str, }, UnknownIdentifier { identifier: Box<str>, }, InvalidOperand { func: char, operand: &'static str, }, UndefinedConversion { into: &'static str, kind: &'static str, }, Quit(i32), Parse(ParseError), InvalidString(InvalidChar), Io(Error), Custom(Box<dyn ErrorTrait>), }
An error occurred whilst executing a knight program.
Variants
A division (or modulus) by zero was attempted.
Show fields
Fields of DivisionByZero
kind: &'static str
What kind of error it is—power, modulo, or division.
An unknown identifier was attempted to be dereferenced.
A function was executed with an invalid operand.
Show fields
A conversion was attempted for a type which doesn’t implement it.
This is only used for Value::Variable
and Value::Function
, as all other types have well-defined conversion semantics.
Show fields
Quit(i32)
Exit with the given status code.
Parse(ParseError)
An error occurred whilst parsing (i.e. EVAL
failed).
InvalidString(InvalidChar)
An invalid string was encountered.
Io(Error)
An i/o error occurred (i.e. `
or PROMPT
failed).
Custom(Box<dyn ErrorTrait>)
An error class that can be used to raise other, custom errors.
Trait Implementations
impl From<InvalidChar> for Error
[src]
impl From<InvalidChar> for Error
[src]fn from(err: InvalidChar) -> Self
[src]
impl From<ParseError> for Error
[src]
impl From<ParseError> for Error
[src]fn from(err: ParseError) -> Self
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl !UnwindSafe for Error