pub struct Diagnostic {
pub error: String,
pub file: Option<String>,
pub line: Option<usize>,
pub column: Option<usize>,
pub category: ErrorCategory,
pub note: Option<String>,
pub help: Option<String>,
pub snippet: Option<String>,
}Expand description
Enhanced diagnostic information for errors
Fields§
§error: StringThe underlying error
file: Option<String>Source file path (if available)
line: Option<usize>Line number (if available)
column: Option<usize>Column number (if available)
category: ErrorCategoryError category (for grouping similar errors)
note: Option<String>Additional context/explanation
help: Option<String>Suggested fix or workaround
snippet: Option<String>Code snippet (if available)
Implementations§
Source§impl Diagnostic
impl Diagnostic
Sourcepub fn from_error(error: &Error, file: Option<String>) -> Self
pub fn from_error(error: &Error, file: Option<String>) -> Self
Create a diagnostic from an error with context
Sourcepub fn quality_score(&self) -> f32
pub fn quality_score(&self) -> f32
Calculate quality score (0.0 to 1.0)
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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Diagnostic
impl Debug for Diagnostic
Auto Trait Implementations§
impl Freeze for Diagnostic
impl RefUnwindSafe for Diagnostic
impl Send for Diagnostic
impl Sync for Diagnostic
impl Unpin for Diagnostic
impl UnwindSafe for Diagnostic
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more