[][src]Struct rslint_parser::ErrorBuilder

pub struct ErrorBuilder {
    pub inner: ParserError,
    pub file_id: usize,
}

A builder for generating codespan diagnostics

Fields

inner: ParserErrorfile_id: usize

Implementations

impl ErrorBuilder[src]

pub fn error(file_id: usize, message: &str) -> Self[src]

Make a new builder with error severity

pub fn warning(file_id: usize, message: &str) -> Self[src]

pub fn new(file_id: usize, diagnostic: Diagnostic) -> Self[src]

Make a new builder with a predefined diagnostic

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

Change the severity of this diagnostic

pub fn primary(
    self,
    range: impl Into<Range<usize>>,
    message: impl Into<String>
) -> Self
[src]

Add a primary label to the diagnostic

pub fn secondary(
    self,
    range: impl Into<Range<usize>>,
    message: impl Into<String>
) -> Self
[src]

Add a secondary label to this diagnostic

pub fn help(self, message: &str) -> Self[src]

Add a help message to the bottom of the diagnostic, that is prefixed by a "help:".

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

Add a help message to the bottom of the diagnostic, that is prefixed by a "note:".

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

Consume the builder and return its diagnostic

Trait Implementations

impl From<ErrorBuilder> for Diagnostic[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> Erasable for T

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

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

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.