Struct rtlola_frontend::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) -> Handler
pub fn new(input_path: PathBuf, input_content: String) -> Handler
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) -> Handler
pub fn without_file(input_content: String) -> Handler
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
sourceimpl From<ParserConfig> for Handler
impl From<ParserConfig> for Handler
sourcefn from(cfg: ParserConfig) -> Handler
fn from(cfg: ParserConfig) -> Handler
Converts to this type from the input type.
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