pub struct SyntaxError {
pub code: &'static str,
pub offset: usize,
pub line: usize,
pub column: usize,
}Expand description
A parse error the HTML Standard defines, from Document::errors.
The parser recovered from it, as the spec says to; it’s for a linter
or an editor to report.
Fields§
§code: &'static strThe error’s name: the HTML Standard’s for those the tokenizer finds
(unexpected-null-character, eof-in-tag), and for those of tree
construction, which the spec leaves unnamed, the names the html5lib
and web-platform-tests suites use (unexpected-end-tag,
expected-doctype-but-got-start-tag).
offset: usizeA byte offset into the input as the parse was given it: where the tokenizer was when it found the error, or the start of the token that tree construction found it in.
line: usizeThe offset’s line and column, as Document::line_col counts
them: from 1, in characters.
column: usizeTrait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
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 SyntaxError
impl Debug for SyntaxError
Source§impl Display for SyntaxError
impl Display for SyntaxError
impl Eq for SyntaxError
Source§impl PartialEq for SyntaxError
impl PartialEq for SyntaxError
impl StructuralPartialEq for SyntaxError
Auto Trait Implementations§
impl Forget for SyntaxError
impl Freeze for SyntaxError
impl Move for SyntaxError
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnsafeUnpin for SyntaxError
impl UnwindSafe for SyntaxError
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