[][src]Struct rslint_core::DiagnosticBuilder

pub struct DiagnosticBuilder(_, _);

A simple builder for creating codespan diagnostics sequentially

Implementations

impl DiagnosticBuilder[src]

pub fn error(
    file_id: usize,
    code: impl Into<String>,
    message: impl Into<String>
) -> Self
[src]

Create a new builder with a severity of error

pub fn warning(
    file_id: usize,
    code: impl Into<String>,
    message: impl Into<String>
) -> Self
[src]

Create a new builder with a severity of warning

pub fn note_diagnostic(
    file_id: usize,
    code: impl Into<String>,
    message: impl Into<String>
) -> Self
[src]

Create a new builder with a severity of note

pub fn severity(self, severity: Severity) -> Self[src]

Change the severity of this diagnostic

pub fn primary(self, range: impl Span, message: impl AsRef<str>) -> Self[src]

Add a primary label to the diagnostic

pub fn secondary(self, range: impl Span, message: impl AsRef<str>) -> Self[src]

Add a secondary label to this diagnostic

pub fn note(self, message: impl AsRef<str>) -> Self[src]

Add a note message to the bottom of the diagnostic (usually a Help: or Note: message)

pub fn finish(self) -> Diagnostic[src]

Trait Implementations

impl Clone for DiagnosticBuilder[src]

impl Debug for DiagnosticBuilder[src]

impl From<DiagnosticBuilder> for Diagnostic[src]

impl From<DiagnosticBuilder> for RuleResult[src]

impl From<DiagnosticBuilder> for Option<RuleResult>[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> Erasable for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.