Struct rtlola_reporting::RtLolaError
source · [−]pub struct RtLolaError { /* private fields */ }
Expand description
An error type to collect diagnostics throughout the frontend.
Implementations
sourceimpl 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.
Trait Implementations
sourceimpl Clone for RtLolaError
impl Clone for RtLolaError
sourcefn clone(&self) -> RtLolaError
fn clone(&self) -> RtLolaError
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for RtLolaError
impl Debug for RtLolaError
sourceimpl Default for RtLolaError
impl Default for RtLolaError
sourceimpl<'de> Deserialize<'de> for RtLolaError
impl<'de> Deserialize<'de> for RtLolaError
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<Diagnostic> for RtLolaError
impl From<Diagnostic> for RtLolaError
sourcefn from(diag: Diagnostic) -> Self
fn from(diag: Diagnostic) -> Self
Converts to this type from the input type.
sourceimpl From<Result<(), RtLolaError>> for RtLolaError
impl From<Result<(), RtLolaError>> for RtLolaError
sourcefn from(res: Result<(), RtLolaError>) -> Self
fn from(res: Result<(), RtLolaError>) -> Self
Converts to this type from the input type.
sourceimpl From<RtLolaError> for Result<(), RtLolaError>
impl From<RtLolaError> for Result<(), RtLolaError>
sourcefn from(e: RtLolaError) -> Self
fn from(e: RtLolaError) -> Self
Converts to this type from the input type.
sourceimpl FromIterator<Diagnostic> for RtLolaError
impl FromIterator<Diagnostic> for RtLolaError
sourcefn from_iter<T: IntoIterator<Item = Diagnostic>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Diagnostic>>(iter: T) -> Self
Creates a value from an iterator. Read more
sourceimpl IntoIterator for RtLolaError
impl IntoIterator for RtLolaError
sourceimpl Serialize for RtLolaError
impl Serialize for RtLolaError
Auto Trait Implementations
impl RefUnwindSafe for RtLolaError
impl Send for RtLolaError
impl Sync for RtLolaError
impl Unpin for RtLolaError
impl UnwindSafe for RtLolaError
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more