Struct rtlola_reporting::Handler
source · pub struct Handler { /* private fields */ }
Expand description
A handler is responsible for emitting warnings and errors
Implementations§
source§impl 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