Reportable

Trait Reportable 

Source
pub trait Reportable<T> {
    // Required methods
    fn or_report(self, errors: &mut ErrorHandler<'_>) -> Option<T>;
    fn report(self, errors: &mut ErrorHandler<'_>) -> Self;
    fn or_do_report<'a>(
        self,
        errors: impl FnOnce() -> &'a mut ErrorHandler<'a>,
    ) -> Option<T>;
}

Required Methods§

Source

fn or_report(self, errors: &mut ErrorHandler<'_>) -> Option<T>

Report the error, then discard the error, returning Some if it was Ok

Source

fn report(self, errors: &mut ErrorHandler<'_>) -> Self

Source

fn or_do_report<'a>( self, errors: impl FnOnce() -> &'a mut ErrorHandler<'a>, ) -> Option<T>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Reportable<()> for Diagnostic

Source§

fn or_report(self, errors: &mut ErrorHandler<'_>) -> Option<()>

Source§

fn report(self, errors: &mut ErrorHandler<'_>) -> Self

Source§

fn or_do_report<'a>( self, errors: impl FnOnce() -> &'a mut ErrorHandler<'a>, ) -> Option<()>

Source§

impl<T, E> Reportable<T> for Result<T, E>

Source§

fn report(self, errors: &mut ErrorHandler<'_>) -> Self

Source§

fn or_report(self, errors: &mut ErrorHandler<'_>) -> Option<T>

Source§

fn or_do_report<'a>( self, errors: impl FnOnce() -> &'a mut ErrorHandler<'a>, ) -> Option<T>

Implementors§