pub struct Diagnostic {
pub code: String,
pub severity: DiagnosticSeverity,
pub message: String,
pub line: Option<u32>,
pub column: Option<u32>,
pub end_line: Option<u32>,
pub end_column: Option<u32>,
pub key: Option<SpanKey>,
}Fields§
§code: String§severity: DiagnosticSeverity§message: String§line: Option<u32>§column: Option<u32>§end_line: Option<u32>§end_column: Option<u32>§key: Option<SpanKey>Structured locator used to resolve source positions in the WASM layer.
Implementations§
Source§impl Diagnostic
impl Diagnostic
pub fn error(code: &str, message: String) -> Self
pub fn warning(code: &str, message: String) -> Self
pub fn with_position(self, line: u32, column: u32) -> Self
Sourcepub fn at(self, key: SpanKey) -> Self
pub fn at(self, key: SpanKey) -> Self
Attach a structured source locator so the caller can resolve the span.
pub fn is_error(&self) -> bool
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
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 moreAuto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnsafeUnpin for Diagnostic
impl UnwindSafe for Diagnostic
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