Struct rtlola_frontend::RtLolaError
source · 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.
Trait Implementations§
source§impl Clone for RtLolaError
impl Clone for RtLolaError
source§fn clone(&self) -> RtLolaError
fn clone(&self) -> RtLolaError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the “default value” for a type. Read more
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Diagnostic> for RtLolaError
impl From<Diagnostic> for RtLolaError
source§fn from(diag: Diagnostic) -> RtLolaError
fn from(diag: Diagnostic) -> RtLolaError
Converts to this type from the input type.
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
Converts to this type from the input type.
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>,
Creates a value from an iterator. Read more
source§impl IntoIterator for RtLolaError
impl IntoIterator for RtLolaError
§type IntoIter = IntoIter<<RtLolaError as IntoIterator>::Item, Global>
type IntoIter = IntoIter<<RtLolaError as IntoIterator>::Item, Global>
Which kind of iterator are we turning this into?
§type Item = Diagnostic
type Item = Diagnostic
The type of the elements being iterated over.
source§fn into_iter(self) -> <RtLolaError as IntoIterator>::IntoIter
fn into_iter(self) -> <RtLolaError as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
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,
Serialize this value into the given Serde serializer. Read more