pub enum ParseError {
MaxDepthExceeded {
max_depth: usize,
span: Option<SourceSpan>,
},
EmptyInput,
EncodingError {
message: String,
},
MalformedHtml {
message: String,
span: Option<SourceSpan>,
},
InternalError(String),
}Expand description
Errors that can occur during HTML parsing.
Variants§
MaxDepthExceeded
Document exceeds maximum nesting depth.
Fields
§
span: Option<SourceSpan>Source location, if available.
EmptyInput
Input is empty or contains only whitespace.
EncodingError
Encoding error in input.
MalformedHtml
Malformed HTML construct.
Fields
§
span: Option<SourceSpan>Source location, if available.
InternalError(String)
Internal parser error.
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn span(&self) -> Option<&SourceSpan>
pub fn span(&self) -> Option<&SourceSpan>
Returns the source span associated with this error, if any.
Sourcepub fn line(&self) -> Option<usize>
pub fn line(&self) -> Option<usize>
Returns the line number of the error (1-indexed), if available.
Sourcepub fn column(&self) -> Option<usize>
pub fn column(&self) -> Option<usize>
Returns the column number of the error (1-indexed), if available.
Sourcepub fn span_context(&self, source: &str) -> Option<SpanContext>
pub fn span_context(&self, source: &str) -> Option<SpanContext>
Returns the span context for display, given the source text.
Trait Implementations§
Source§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