pub struct ParseWarning {
pub severity: WarningSeverity,
pub message: String,
pub span: Option<SourceSpan>,
pub spec_reference: Option<String>,
}Expand description
A warning or error encountered during parsing.
Fields§
§severity: WarningSeveritySeverity of the warning.
message: StringDescription of the issue.
span: Option<SourceSpan>Location in source, if available.
spec_reference: Option<String>HTML5 spec reference, if applicable.
Implementations§
Source§impl ParseWarning
impl ParseWarning
Sourcepub fn new(severity: WarningSeverity, message: impl Into<String>) -> Self
pub fn new(severity: WarningSeverity, message: impl Into<String>) -> Self
Creates a new parse warning.
Sourcepub fn with_span(self, span: SourceSpan) -> Self
pub fn with_span(self, span: SourceSpan) -> Self
Sets the span for this warning.
Sourcepub fn with_spec_reference(self, reference: impl Into<String>) -> Self
pub fn with_spec_reference(self, reference: impl Into<String>) -> Self
Sets the spec reference for this warning.
Trait Implementations§
Source§impl Clone for ParseWarning
impl Clone for ParseWarning
Source§fn clone(&self) -> ParseWarning
fn clone(&self) -> ParseWarning
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 moreAuto Trait Implementations§
impl Freeze for ParseWarning
impl RefUnwindSafe for ParseWarning
impl Send for ParseWarning
impl Sync for ParseWarning
impl Unpin for ParseWarning
impl UnwindSafe for ParseWarning
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