Struct syntax_error::ReportBuilder
source · pub struct ReportBuilder<S: Span> { /* private fields */ }
Expand description
A type used to build a Report
.
Implementations§
source§impl<S: Span> ReportBuilder<S>
impl<S: Span> ReportBuilder<S>
sourcepub fn with_code(self, code: usize) -> Self
pub fn with_code(self, code: usize) -> Self
Give this report a numerical code that may be used to more precisely look up the error in documentation.
sourcepub fn set_message<M: ToString>(&mut self, message: M)
pub fn set_message<M: ToString>(&mut self, message: M)
Set the message of this report.
sourcepub fn with_message<M: ToString>(self, message: M) -> Self
pub fn with_message<M: ToString>(self, message: M) -> Self
Add a message to this report.
sourcepub fn add_labels<L: IntoIterator<Item = Label<S>>>(&mut self, labels: L)
pub fn add_labels<L: IntoIterator<Item = Label<S>>>(&mut self, labels: L)
Add multiple labels to the report.
sourcepub fn with_label(self, label: Label<S>) -> Self
pub fn with_label(self, label: Label<S>) -> Self
Add a label to the report.
sourcepub fn with_labels<L: IntoIterator<Item = Label<S>>>(self, labels: L) -> Self
pub fn with_labels<L: IntoIterator<Item = Label<S>>>(self, labels: L) -> Self
Add multiple labels to the report.
sourcepub fn with_config(self, config: Config) -> Self
pub fn with_config(self, config: Config) -> Self
Use the given Config
to determine diagnostic attributes.
Trait Implementations§
Auto Trait Implementations§
impl<S> !RefUnwindSafe for ReportBuilder<S>
impl<S> !Send for ReportBuilder<S>
impl<S> !Sync for ReportBuilder<S>
impl<S> Unpin for ReportBuilder<S>where S: Unpin, <<S as Span>::SourceId as ToOwned>::Owned: Unpin,
impl<S> !UnwindSafe for ReportBuilder<S>
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