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

An error type to collect diagnostics throughout the frontend.

Implementations§

source§

impl RtLolaError

source

pub fn new() -> RtLolaError

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>(
    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

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<(), Error>

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

impl Default for RtLolaError

source§

fn default() -> RtLolaError

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

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

source§

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

source§

fn from(diag: Diagnostic) -> RtLolaError

Converts to this type from the input type.
source§

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

source§

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

Converts to this type from the input type.
source§

impl FromIterator<Diagnostic> for RtLolaError

source§

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

Creates a value from an iterator. Read more
source§

impl IntoIterator for RtLolaError

§

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

Which kind of iterator are we turning this into?
§

type Item = Diagnostic

The type of the elements being iterated over.
source§

fn into_iter(self) -> <RtLolaError as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
source§

impl Serialize for RtLolaError

source§

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere
    T: Clone,

§

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, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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