Struct diagnostic::DiagnosticBuilder
source · pub struct DiagnosticBuilder { /* private fields */ }Expand description
A type used to build a Diagnostic.
Implementations§
source§impl DiagnosticBuilder
impl DiagnosticBuilder
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 set_location(&mut self, file: FileID, start: Option<u32>)
pub fn set_location(&mut self, file: FileID, start: Option<u32>)
Set the location of this report.
sourcepub fn with_location(self, file: FileID, start: Option<u32>) -> Self
pub fn with_location(self, file: FileID, start: Option<u32>) -> Self
Set the location of this report.
sourcepub fn add_labels<L: IntoIterator<Item = Label>>(&mut self, labels: L)
pub fn add_labels<L: IntoIterator<Item = Label>>(&mut self, labels: L)
Add multiple labels to the report.
sourcepub fn with_label(self, label: Label) -> Self
pub fn with_label(self, label: Label) -> Self
Add a label to the report.
sourcepub fn with_labels<L: IntoIterator<Item = Label>>(self, labels: L) -> Self
pub fn with_labels<L: IntoIterator<Item = Label>>(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.
sourcepub fn finish(self) -> Diagnostic
pub fn finish(self) -> Diagnostic
Finish building the Diagnostic.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DiagnosticBuilder
impl !Send for DiagnosticBuilder
impl !Sync for DiagnosticBuilder
impl Unpin for DiagnosticBuilder
impl !UnwindSafe for DiagnosticBuilder
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