Struct ErrorManager

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

Registers errors

Implementations§

Source§

impl ErrorManager

Source

pub fn new() -> Self

Source

pub fn emit_error(&mut self, err: impl Error + 'static)

Source

pub fn emit_warning(&mut self, err: impl Error + 'static)

Source

pub fn n_errors(&self) -> usize

Source

pub fn has_errors(&self) -> bool

Source

pub fn errors(&self) -> &[Box<dyn Error>]

Source

pub fn errors_iterator_cast<E: Error>(&self) -> impl Iterator<Item = &E>

Gets an iterator over the errors inside self, casting them to the concrete error type specified

This is super unsafe, and should only be used on tests

§Panics

If if fails to downcast an error into E

Source

pub fn print_errors(&self, src: &SourceMap, out: &mut dyn Write) -> Result

Source

pub fn n_warnings(&self) -> usize

Source

pub fn clear_warnings(&mut self)

Source

pub fn print_warnings(&self, src: &SourceMap, out: &mut dyn Write) -> Result

Source

pub fn merge(&mut self, other: &mut ErrorManager)

Trait Implementations§

Source§

impl Default for ErrorManager

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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.