pub struct RtLolaError { /* private fields */ }
Expand description
An error type to collect diagnostics throughout the frontend.
Implementations§
Source§impl RtLolaError
impl RtLolaError
Sourcepub fn add(&mut self, diag: Diagnostic)
pub fn add(&mut self, diag: Diagnostic)
Adds a Diagnostic to the error
Sourcepub fn as_slice(&self) -> &[Diagnostic]
pub fn as_slice(&self) -> &[Diagnostic]
Returns a slice of all Diagnostics of the error
Sourcepub fn num_errors(&self) -> usize
pub fn num_errors(&self) -> usize
Returns the number of Diagnostics with the severity error
Sourcepub fn num_warnings(&self) -> usize
pub fn num_warnings(&self) -> usize
Returns the number of Diagnostics with the severity warning
Sourcepub fn join(&mut self, other: RtLolaError)
pub fn join(&mut self, other: RtLolaError)
Merges to errors into one by combining the internal collections
Sourcepub fn iter(&self) -> impl Iterator<Item = &Diagnostic>
pub fn iter(&self) -> impl Iterator<Item = &Diagnostic>
Returns an iterator over the Diagnostics of the error
Sourcepub fn combine<L, R, U, F: FnOnce(L, R) -> U>(
left: Result<L, RtLolaError>,
right: Result<R, RtLolaError>,
op: F,
) -> Result<U, RtLolaError>
pub fn combine<L, R, U, F: FnOnce(L, R) -> U>( left: Result<L, RtLolaError>, right: Result<R, RtLolaError>, op: F, ) -> Result<U, RtLolaError>
Combines to Results with an RtLolaError as the Error type into a single Result.
If both results are Ok then op
is applied to these values to construct the new Ok value.
If one of the errors is Err then the Err is returned
If both Results are errors then the RtLolaErrors are merged using RtLolaError::join and returned.
Source§impl RtLolaError
impl RtLolaError
Sourcepub fn collect<T, Q: FromIterator<T> + Extend<T>>(
iter: impl IntoIterator<Item = Result<T, Self>>,
) -> Result<Q, RtLolaError>
pub fn collect<T, Q: FromIterator<T> + Extend<T>>( iter: impl IntoIterator<Item = Result<T, Self>>, ) -> Result<Q, RtLolaError>
Collects the iterator of Result’s into a Result of a collection, while concatenating all RTLola errors together
Trait Implementations§
Source§impl Clone for RtLolaError
impl Clone for RtLolaError
Source§fn clone(&self) -> RtLolaError
fn clone(&self) -> RtLolaError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more