[−][src]Struct diagnostics::Diagnostics
Instead of writing errors, warnings and lints generated in the different compiler stages directly to stdout, they are collected in this object.
This has several advantages:
- the output level can be adapted by users.
- we have a single source responsible for formatting compiler messages.
Methods
impl Diagnostics[src]
impl Diagnosticspub fn new(writer: Box<dyn WriteColor>) -> Self[src]
pub fn new(writer: Box<dyn WriteColor>) -> Selfpub fn errored(&self) -> bool[src]
pub fn errored(&self) -> boolTrue when an error message was emitted, false if only warnings were emitted.
pub fn count(&self, level: MessageLevel) -> usize[src]
pub fn count(&self, level: MessageLevel) -> usizepub fn write_statistics(&self)[src]
pub fn write_statistics(&self)pub fn emit(&self, level: MessageLevel, kind: MaybeSpanned<&dyn Display>)[src]
pub fn emit(&self, level: MessageLevel, kind: MaybeSpanned<&dyn Display>)Generate an error or a warning that is printed to the
writer given in the new constructor. Most of the time
this will be stderr.
pub fn warning<'a, 'b, T: Printable<'a, 'b> + ?Sized>(&self, kind: &'b T)[src]
pub fn warning<'a, 'b, T: Printable<'a, 'b> + ?Sized>(&self, kind: &'b T)pub fn error<'a, 'b, T: Printable<'a, 'b> + ?Sized>(&self, kind: &'b T)[src]
pub fn error<'a, 'b, T: Printable<'a, 'b> + ?Sized>(&self, kind: &'b T)pub fn info<'a, 'b, T: Printable<'a, 'b> + ?Sized>(&self, kind: &'b T)[src]
pub fn info<'a, 'b, T: Printable<'a, 'b> + ?Sized>(&self, kind: &'b T)Auto Trait Implementations
impl !Send for Diagnostics
impl !Send for Diagnosticsimpl !Sync for Diagnostics
impl !Sync for DiagnosticsBlanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut Timpl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId