EAccum

Struct EAccum 

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

Error accumulator to be able to

  • emit several fatal errors at once
  • emit warnings

Implementations§

Source§

impl EAccum

Source

pub fn error<T, E: IntoError>(&mut self, e: E) -> Option<T>

Push a fatal error to the accumulator. Always returns a None so that you can use the construct acc.error(...)?;

Source

pub fn warning<E: IntoError>(&mut self, e: E)

Push a warning to the accumulator.

Source

pub fn is_fatal(&self) -> bool

Determine if there were any errors inserted.

Source

pub fn fetch(self) -> (Vec<Error>, Vec<Error>)

Extract the errors and warnings to be emitted.

Source

pub fn scope(&mut self) -> EAccumScope<'_>

Create a new scope to record the success of intermediate computation.

Trait Implementations§

Source§

impl Default for EAccum

Source§

fn default() -> EAccum

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

Auto Trait Implementations§

§

impl Freeze for EAccum

§

impl RefUnwindSafe for EAccum

§

impl !Send for EAccum

§

impl !Sync for EAccum

§

impl Unpin for EAccum

§

impl UnwindSafe for EAccum

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> 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, 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.