pub struct Handler<'a> { /* private fields */ }
Expand description
A handler is responsible for emitting warnings and errors
Implementations§
Source§impl<'a> Handler<'a>
impl<'a> Handler<'a>
Sourcepub fn new(input_path: &'a Path, input_content: &'a str) -> Self
pub fn new(input_path: &'a Path, input_content: &'a str) -> 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: &'a str) -> Self
pub fn without_file(input_content: &'a str) -> 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<'a> !Freeze for Handler<'a>
impl<'a> RefUnwindSafe for Handler<'a>
impl<'a> !Send for Handler<'a>
impl<'a> !Sync for Handler<'a>
impl<'a> Unpin for Handler<'a>
impl<'a> UnwindSafe for Handler<'a>
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