pub struct ParseError {
pub kind: ParseErrorKind,
pub message: String,
pub line: usize,
pub column: usize,
pub recovery_hint: Option<String>,
}Expand description
Parse error
Fields§
§kind: ParseErrorKindError type
message: StringError message
line: usizeLine number where the error occurred
column: usizeColumn number where the error occurred
recovery_hint: Option<String>Error recovery hint
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn new(
kind: ParseErrorKind,
message: String,
line: usize,
column: usize,
recovery_hint: Option<String>,
) -> Self
pub fn new( kind: ParseErrorKind, message: String, line: usize, column: usize, recovery_hint: Option<String>, ) -> Self
Create a new parse error
Sourcepub fn unexpected_token(
expected: &str,
found: &str,
line: usize,
column: usize,
) -> Self
pub fn unexpected_token( expected: &str, found: &str, line: usize, column: usize, ) -> Self
Create an unexpected token error
pub fn syntax_error(msg: &str, line: usize, column: usize) -> Self
Sourcepub fn invalid_selector_value(value: &str, line: usize, column: usize) -> Self
pub fn invalid_selector_value(value: &str, line: usize, column: usize) -> Self
Create an invalid selector value error
Sourcepub fn nesting_too_deep(max_depth: usize, line: usize, column: usize) -> Self
pub fn nesting_too_deep(max_depth: usize, line: usize, column: usize) -> Self
Create a nesting too deep error
Sourcepub fn multiple_text_selectors(line: usize, column: usize) -> Self
pub fn multiple_text_selectors(line: usize, column: usize) -> Self
Create a multiple text selectors error
Sourcepub fn element_after_text_selector(line: usize, column: usize) -> Self
pub fn element_after_text_selector(line: usize, column: usize) -> Self
Create an element after text selector 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 · 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 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()
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin 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