Skip to main content

Diagnostician

Struct Diagnostician 

Source
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

Source

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

Source

pub fn handle(&mut self, diagnostics: &[Diagnostic]) -> Severity

Assess and reports the given diagnostics.

Source

pub fn null_diagnostician() -> Diagnostician

Creates a null-diagnostician that does not report diagnostics

Source

pub fn buffered() -> Diagnostician

Creates a buffered-diagnostician that saves its reports in a buffer

Source

pub fn clang_format_diagnostician() -> Diagnostician

Creates a clang-format-diagnostician that reports diagnostics in clang format

Source

pub fn with_configuration(self, configuration: DiagnosticsConfiguration) -> Self

Source

pub fn explain(&self, error: &str) -> String

Explain the error with the given code by consulting the diagnostics registry

Source

pub fn get_diagnostic_configuration(&self) -> String

Trait Implementations§

Source§

impl Default for Diagnostician

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl DiagnosticAssessor for Diagnostician

Source§

fn assess(&self, d: &Diagnostic) -> Severity

determines the severity of the given diagnostic
Source§

fn explain(&self, _error: &str) -> String

Explains the given error based on the diagnostician information
Source§

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

Source§

fn report(&mut self, diagnostics: &[ResolvedDiagnostics])

reports the given diagnostic
Source§

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)
Source§

fn buffer(&self) -> Option<String>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.