pub struct Diagnostician { /* private fields */ }Expand description
the Diagnostician handle’s Diangostics with the help of a assessor and a reporter
Implementations§
Source§impl Diagnostician
impl Diagnostician
Sourcepub fn register_file(&mut self, id: String, src: String) -> usize
pub fn register_file(&mut self, id: String, src: String) -> usize
registers the given source-code at the diagnostician, so it can preview errors in the source returns the id to use to reference the given file
Sourcepub fn handle(&mut self, diagnostics: &[Diagnostic]) -> Severity
pub fn handle(&mut self, diagnostics: &[Diagnostic]) -> Severity
Assess and reports the given diagnostics.
Sourcepub fn null_diagnostician() -> Diagnostician
pub fn null_diagnostician() -> Diagnostician
Creates a null-diagnostician that does not report diagnostics
Sourcepub fn buffered() -> Diagnostician
pub fn buffered() -> Diagnostician
Creates a buffered-diagnostician that saves its reports in a buffer
Sourcepub fn clang_format_diagnostician() -> Diagnostician
pub fn clang_format_diagnostician() -> Diagnostician
Creates a clang-format-diagnostician that reports diagnostics in clang format
pub fn with_configuration(self, configuration: DiagnosticsConfiguration) -> Self
Sourcepub fn explain(&self, error: &str) -> String
pub fn explain(&self, error: &str) -> String
Explain the error with the given code by consulting the diagnostics registry
pub fn get_diagnostic_configuration(&self) -> String
Trait Implementations§
Source§impl Default for Diagnostician
impl Default for Diagnostician
Source§impl DiagnosticAssessor for Diagnostician
impl DiagnosticAssessor for Diagnostician
Source§fn assess(&self, d: &Diagnostic) -> Severity
fn assess(&self, d: &Diagnostic) -> Severity
determines the severity of the given diagnostic
Source§fn explain(&self, _error: &str) -> String
fn explain(&self, _error: &str) -> String
Explains the given error based on the diagnostician information
Source§fn get_diagnostic_configuration(&self) -> String
fn get_diagnostic_configuration(&self) -> String
Returns a serialized version of the diagnostics configuration this diagnostician will use
to assess errors
Source§impl DiagnosticReporter for Diagnostician
impl DiagnosticReporter for Diagnostician
Source§fn report(&mut self, diagnostics: &[ResolvedDiagnostics])
fn report(&mut self, diagnostics: &[ResolvedDiagnostics])
reports the given diagnostic
Source§fn register(&mut self, path: String, src: String) -> usize
fn register(&mut self, path: String, src: String) -> usize
register the given path & src and returns an ID to indicate
a relationship the given src (diagnostics for this src need
to use this id)
fn buffer(&self) -> Option<String>
Auto Trait Implementations§
impl Freeze for Diagnostician
impl !RefUnwindSafe for Diagnostician
impl !Send for Diagnostician
impl !Sync for Diagnostician
impl Unpin for Diagnostician
impl UnsafeUnpin for Diagnostician
impl !UnwindSafe for Diagnostician
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