pub struct DiagHandler {
pub diag_list: DiagList,
/* private fields */
}Expand description
Handler for diagnostics.
Fields§
§diag_list: DiagListThe list of diagnostics per source file.
Implementations§
Source§impl DiagHandler
Handler for diagnostics.
impl DiagHandler
Handler for diagnostics.
Sourcepub fn pretty_print(
&self,
f: &mut dyn Write,
source_by_hash: &impl GetSourceByHash,
) -> Result
pub fn pretty_print( &self, f: &mut dyn Write, source_by_hash: &impl GetSourceByHash, ) -> Result
Pretty print all errors of all files.
Sourcepub fn warning_count(&self) -> u32
pub fn warning_count(&self) -> u32
Return overall number of occurred errors.
Sourcepub fn error_count(&self) -> u32
pub fn error_count(&self) -> u32
Return overall number of occurred errors.
Sourcepub fn error_lines(&self) -> HashSet<usize>
pub fn error_lines(&self) -> HashSet<usize>
return lines with errors
Sourcepub fn warning_lines(&self) -> HashSet<usize>
pub fn warning_lines(&self) -> HashSet<usize>
return lines with warnings
Trait Implementations§
Source§impl Default for DiagHandler
impl Default for DiagHandler
Source§fn default() -> DiagHandler
fn default() -> DiagHandler
Returns the “default value” for a type. Read more
Source§impl PushDiag for DiagHandler
impl PushDiag for DiagHandler
Source§fn push_diag(&mut self, diag: Diagnostic) -> DiagResult<()>
fn push_diag(&mut self, diag: Diagnostic) -> DiagResult<()>
Push a diagnostic message (must be implemented).
Source§fn trace(&mut self, src: &impl SrcReferrer, message: String)
fn trace(&mut self, src: &impl SrcReferrer, message: String)
Push new trace message.
Source§fn info(&mut self, src: &impl SrcReferrer, message: String)
fn info(&mut self, src: &impl SrcReferrer, message: String)
Push new informative message.
Source§fn warning(
&mut self,
src: &impl SrcReferrer,
err: impl Error + 'static,
) -> DiagResult<()>
fn warning( &mut self, src: &impl SrcReferrer, err: impl Error + 'static, ) -> DiagResult<()>
Push new warning.
Source§fn error(
&mut self,
src: &impl SrcReferrer,
err: impl Error + 'static,
) -> DiagResult<()>
fn error( &mut self, src: &impl SrcReferrer, err: impl Error + 'static, ) -> DiagResult<()>
Push new error.
Auto Trait Implementations§
impl Freeze for DiagHandler
impl !RefUnwindSafe for DiagHandler
impl !Send for DiagHandler
impl !Sync for DiagHandler
impl Unpin for DiagHandler
impl !UnwindSafe for DiagHandler
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more