pub struct RtLolaError { /* private fields */ }
Expand description
An error type to collect diagnostics throughout the frontend.
Implementations§
Source§impl RtLolaError
impl RtLolaError
Sourcepub fn new() -> RtLolaError
pub fn new() -> RtLolaError
Creates a new error
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>(
left: Result<L, RtLolaError>,
right: Result<R, RtLolaError>,
op: F,
) -> Result<U, RtLolaError>where
F: FnOnce(L, R) -> U,
pub fn combine<L, R, U, F>(
left: Result<L, RtLolaError>,
right: Result<R, RtLolaError>,
op: F,
) -> Result<U, RtLolaError>where
F: FnOnce(L, R) -> U,
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>(
iter: impl IntoIterator<Item = Result<T, RtLolaError>>,
) -> Result<Q, RtLolaError>where
Q: FromIterator<T> + Extend<T>,
pub fn collect<T, Q>(
iter: impl IntoIterator<Item = Result<T, RtLolaError>>,
) -> Result<Q, RtLolaError>where
Q: FromIterator<T> + Extend<T>,
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 moreSource§impl Debug for RtLolaError
impl Debug for RtLolaError
Source§impl Default for RtLolaError
impl Default for RtLolaError
Source§fn default() -> RtLolaError
fn default() -> RtLolaError
Source§impl<'de> Deserialize<'de> for RtLolaError
impl<'de> Deserialize<'de> for RtLolaError
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RtLolaError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RtLolaError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for RtLolaError
impl Display for RtLolaError
Source§impl Error for RtLolaError
impl Error for RtLolaError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Diagnostic> for RtLolaError
impl From<Diagnostic> for RtLolaError
Source§fn from(diag: Diagnostic) -> RtLolaError
fn from(diag: Diagnostic) -> RtLolaError
Source§impl From<Result<(), RtLolaError>> for RtLolaError
impl From<Result<(), RtLolaError>> for RtLolaError
Source§fn from(res: Result<(), RtLolaError>) -> RtLolaError
fn from(res: Result<(), RtLolaError>) -> RtLolaError
Source§impl FromIterator<Diagnostic> for RtLolaError
impl FromIterator<Diagnostic> for RtLolaError
Source§fn from_iter<T>(iter: T) -> RtLolaErrorwhere
T: IntoIterator<Item = Diagnostic>,
fn from_iter<T>(iter: T) -> RtLolaErrorwhere
T: IntoIterator<Item = Diagnostic>,
Source§impl IntoIterator for RtLolaError
impl IntoIterator for RtLolaError
Source§type IntoIter = IntoIter<<RtLolaError as IntoIterator>::Item>
type IntoIter = IntoIter<<RtLolaError as IntoIterator>::Item>
Source§type Item = Diagnostic
type Item = Diagnostic
Source§fn into_iter(self) -> <RtLolaError as IntoIterator>::IntoIter
fn into_iter(self) -> <RtLolaError as IntoIterator>::IntoIter
Source§impl Serialize for RtLolaError
impl Serialize for RtLolaError
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for RtLolaError
impl RefUnwindSafe for RtLolaError
impl Send for RtLolaError
impl Sync for RtLolaError
impl Unpin for RtLolaError
impl UnwindSafe for RtLolaError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more