Struct ariadne::ReportBuilder

source ·
pub struct ReportBuilder<'a, S: Span> { /* private fields */ }
Expand description

A type used to build a Report.

Implementations§

source§

impl<'a, S: Span> ReportBuilder<'a, S>

source

pub fn with_code<C: Display>(self, code: C) -> Self

Give this report a numerical code that may be used to more precisely look up the error in documentation.

source

pub fn set_message<M: ToString>(&mut self, msg: M)

Set the message of this report.

source

pub fn with_message<M: ToString>(self, msg: M) -> Self

Add a message to this report.

source

pub fn set_note<N: ToString>(&mut self, note: N)

Set the note of this report.

source

pub fn with_note<N: ToString>(self, note: N) -> Self

Set the note of this report.

source

pub fn set_help<N: ToString>(&mut self, note: N)

Set the help message of this report.

source

pub fn with_help<N: ToString>(self, note: N) -> Self

Set the help message of this report.

source

pub fn add_label(&mut self, label: Label<S>)

Add a label to the report.

source

pub fn add_labels<L: IntoIterator<Item = Label<S>>>(&mut self, labels: L)

Add multiple labels to the report.

source

pub fn with_label(self, label: Label<S>) -> Self

Add a label to the report.

source

pub fn with_labels<L: IntoIterator<Item = Label<S>>>(self, labels: L) -> Self

Add multiple labels to the report.

source

pub fn with_config(self, config: Config) -> Self

Use the given Config to determine diagnostic attributes.

source

pub fn finish(self) -> Report<'a, S>

Finish building the Report.

Trait Implementations§

source§

impl<'a, S: Span> Debug for ReportBuilder<'a, S>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, S> RefUnwindSafe for ReportBuilder<'a, S>

§

impl<'a, S> Send for ReportBuilder<'a, S>
where S: Send, <<S as Span>::SourceId as ToOwned>::Owned: Send,

§

impl<'a, S> Sync for ReportBuilder<'a, S>
where S: Sync, <<S as Span>::SourceId as ToOwned>::Owned: Sync,

§

impl<'a, S> Unpin for ReportBuilder<'a, S>
where S: Unpin, <<S as Span>::SourceId as ToOwned>::Owned: Unpin,

§

impl<'a, S> UnwindSafe for ReportBuilder<'a, S>
where S: UnwindSafe, <<S as Span>::SourceId as ToOwned>::Owned: UnwindSafe,

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>,

§

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>,

§

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.