Enum CustomLexError
pub enum CustomLexError {
Lex(LexError),
Custom {
message: String,
payload: Option<ForeignError>,
},
}Expand description
A TokenSource failure.
Variants§
Lex(LexError)
A structured lex failure — surfaces through the parse path with the same
ParseError class the built-in lexer arms produce (a custom source
wrapping BasicLexer keeps UnexpectedCharacters parity, exactly as
Lark’s CustomLexerNew lets the wrapped lexer’s exception escape).
Custom
An arbitrary source failure. payload is an opaque value the caller can
downcast back out of ParseError::CustomLex — the identity-preserving
channel a binding threads its host exception through (e.g. a stored
PyErr), mirroring Lark, where the custom lexer’s exception escapes
parse unwrapped.
Implementations§
§impl CustomLexError
impl CustomLexError
Trait Implementations§
§impl Debug for CustomLexError
impl Debug for CustomLexError
§impl Display for CustomLexError
impl Display for CustomLexError
§impl Error for CustomLexError
impl Error for CustomLexError
§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()
Auto Trait Implementations§
impl !RefUnwindSafe for CustomLexError
impl !UnwindSafe for CustomLexError
impl Freeze for CustomLexError
impl Send for CustomLexError
impl Sync for CustomLexError
impl Unpin for CustomLexError
impl UnsafeUnpin for CustomLexError
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
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of [
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a [
CompactString]. Read more