pub enum LoadError {
UnsafeCall,
UnexpectedByte {
byte: Option<u8>,
pos: usize,
},
Unterminated {
what: &'static str,
},
UnknownVariable(String),
BadNumber(String),
Syntax(String),
}Expand description
An error from load.
Each variant names a distinct failure the parser can hit, so callers can match on the mode instead of parsing a message string.
Variants§
UnsafeCall
A function call reached in safe mode. The sandbox rejects calls.
UnexpectedByte
An unexpected byte at a source position. byte is None at end of input.
Fields
Unterminated
A string or table that never closed. what names which one.
UnknownVariable(String)
A return NAME in a do block that names an undeclared local.
BadNumber(String)
A numeric literal that did not parse.
Syntax(String)
Any other syntax error, with a message.
Trait Implementations§
impl Eq for LoadError
Source§impl Error for LoadError
impl Error for LoadError
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()
impl StructuralPartialEq for LoadError
Auto Trait Implementations§
impl Freeze for LoadError
impl RefUnwindSafe for LoadError
impl Send for LoadError
impl Sync for LoadError
impl Unpin for LoadError
impl UnsafeUnpin for LoadError
impl UnwindSafe for LoadError
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