Struct RtLolaError

Source
pub struct RtLolaError { /* private fields */ }
Expand description

An error type to collect diagnostics throughout the frontend.

Implementations§

Source§

impl RtLolaError

Source

pub fn new() -> Self

Creates a new error

Source

pub fn add(&mut self, diag: Diagnostic)

Adds a Diagnostic to the error

Source

pub fn as_slice(&self) -> &[Diagnostic]

Returns a slice of all Diagnostics of the error

Source

pub fn num_errors(&self) -> usize

Returns the number of Diagnostics with the severity error

Source

pub fn num_warnings(&self) -> usize

Returns the number of Diagnostics with the severity warning

Source

pub fn join(&mut self, other: RtLolaError)

Merges to errors into one by combining the internal collections

Source

pub fn iter(&self) -> impl Iterator<Item = &Diagnostic>

Returns an iterator over the Diagnostics of the error

Source

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

Source

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

Source§

fn clone(&self) -> RtLolaError

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RtLolaError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RtLolaError

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RtLolaError

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for RtLolaError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for RtLolaError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Diagnostic> for RtLolaError

Source§

fn from(diag: Diagnostic) -> Self

Converts to this type from the input type.
Source§

impl From<Result<(), RtLolaError>> for RtLolaError

Source§

fn from(res: Result<(), RtLolaError>) -> Self

Converts to this type from the input type.
Source§

impl From<RtLolaError> for Result<(), RtLolaError>

Source§

fn from(e: RtLolaError) -> Self

Converts to this type from the input type.
Source§

impl FromIterator<Diagnostic> for RtLolaError

Source§

fn from_iter<T: IntoIterator<Item = Diagnostic>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl IntoIterator for RtLolaError

Source§

type IntoIter = IntoIter<<RtLolaError as IntoIterator>::Item>

Which kind of iterator are we turning this into?
Source§

type Item = Diagnostic

The type of the elements being iterated over.
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl Serialize for RtLolaError

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,