pub enum ParseError {
ParseFailed,
SerializationFailed,
DeserializationFailed,
InvalidToken(String),
UnexpectedEof,
InvalidUnicode,
InvalidUtf8(String),
ScannerError(String),
LanguageLoadFailed,
}Expand description
Error types for tree-sitter Perl parser
Variants§
ParseFailed
Failed to parse the input
SerializationFailed
Failed to serialize scanner state
DeserializationFailed
Failed to deserialize scanner state
InvalidToken(String)
Invalid token encountered
UnexpectedEof
Unexpected end of input
InvalidUnicode
Invalid Unicode sequence
InvalidUtf8(String)
Invalid UTF-8 sequence encountered
ScannerError(String)
Scanner error occurred
LanguageLoadFailed
Language loading failed
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn new(kind: ParseErrorKind, position: usize, message: String) -> Self
pub fn new(kind: ParseErrorKind, position: usize, message: String) -> Self
Create a new parse error
Sourcepub fn unterminated_string(position: (usize, usize)) -> Self
pub fn unterminated_string(position: (usize, usize)) -> Self
Create an error for unterminated string literals
Sourcepub fn invalid_token(token: String, position: (usize, usize)) -> Self
pub fn invalid_token(token: String, position: (usize, usize)) -> Self
Create an error for invalid tokens
Sourcepub fn unicode_error(_message: &str) -> Self
pub fn unicode_error(_message: &str) -> Self
Create an error for Unicode-related issues
Sourcepub fn scanner_error_simple(message: &str) -> Self
pub fn scanner_error_simple(message: &str) -> Self
Create a simple scanner error
Trait Implementations§
Source§impl Clone for ParseError
impl Clone for ParseError
Source§fn clone(&self) -> ParseError
fn clone(&self) -> ParseError
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 ParseError
impl Debug for ParseError
Source§impl<'de> Deserialize<'de> for ParseError
impl<'de> Deserialize<'de> for ParseError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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 From<Error> for ParseError
impl From<Error> for ParseError
Source§impl From<FromUtf8Error> for ParseError
impl From<FromUtf8Error> for ParseError
Source§fn from(err: FromUtf8Error) -> Self
fn from(err: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<ScannerError> for ParseError
impl From<ScannerError> for ParseError
Source§fn from(err: ScannerError) -> Self
fn from(err: ScannerError) -> Self
Converts to this type from the input type.
Source§impl From<UnicodeError> for ParseError
impl From<UnicodeError> for ParseError
Source§fn from(err: UnicodeError) -> Self
fn from(err: UnicodeError) -> Self
Converts to this type from the input type.
Source§impl From<Utf8Error> for ParseError
impl From<Utf8Error> for ParseError
Source§impl PartialEq for ParseError
impl PartialEq for ParseError
Source§fn eq(&self, other: &ParseError) -> bool
fn eq(&self, other: &ParseError) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ParseError
impl Serialize for ParseError
impl Eq for ParseError
impl StructuralPartialEq for ParseError
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnsafeUnpin for ParseError
impl UnwindSafe for ParseError
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