Struct rtlola_reporting::Handler
source · [−]pub struct Handler { /* private fields */ }
Expand description
A handler is responsible for emitting warnings and errors
Implementations
sourceimpl Handler
impl Handler
sourcepub fn new(input_path: PathBuf, input_content: String) -> Self
pub fn new(input_path: PathBuf, input_content: String) -> Self
Creates a new Handler
input_path
refers to the path of the input file
input_content
refers to the content of the input file
sourcepub fn without_file(input_content: String) -> Self
pub fn without_file(input_content: String) -> Self
Creates a new handler without a path.
sourcepub fn emit(&self, diag: &Diagnostic)
pub fn emit(&self, diag: &Diagnostic)
Emits a single Diagnostic to the terminal
sourcepub fn emit_error(&self, err: &RtLolaError)
pub fn emit_error(&self, err: &RtLolaError)
Emits a RtLolaError to the console
sourcepub fn contains_error(&self) -> bool
pub fn contains_error(&self) -> bool
Returns true if an error has occurred
sourcepub fn emitted_errors(&self) -> usize
pub fn emitted_errors(&self) -> usize
Returns the number of emitted errors
sourcepub fn emitted_warnings(&self) -> usize
pub fn emitted_warnings(&self) -> usize
Returns the number of emitted warnings
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Handler
impl !Send for Handler
impl !Sync for Handler
impl Unpin for Handler
impl UnwindSafe for Handler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more