pub struct DiagHandler { /* private fields */ }
Expand description
Handler for diagnostics.
Implementations§
Source§impl DiagHandler
Handler for diagnostics.
impl DiagHandler
Handler for diagnostics.
Sourcepub fn new(error_limit: Option<u32>, warnings_as_errors: bool) -> Self
pub fn new(error_limit: Option<u32>, warnings_as_errors: bool) -> Self
Create new diag handler.
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 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) -> EvalResult<()>
fn push_diag(&mut self, diag: Diagnostic) -> EvalResult<()>
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,
error: impl Error + 'static,
) -> EvalResult<()>
fn warning( &mut self, src: &impl SrcReferrer, error: impl Error + 'static, ) -> EvalResult<()>
Push new warning.
Source§fn error(
&mut self,
src: &impl SrcReferrer,
error: impl Error + 'static,
) -> EvalResult<()>
fn error( &mut self, src: &impl SrcReferrer, error: impl Error + 'static, ) -> EvalResult<()>
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