pub trait Failure {
    type Error: FailureMode;

    // Required method
    fn failure(self) -> Option<Self::Error>;

    // Provided method
    fn get_error(
        self,
        time: &Time,
        logged_errors: &mut LoggedErrors<Self>
    ) -> Option<Self::Error>
       where Self: Sized { ... }
}
Expand description

Something that can be returned by a function marked with #[sysfail(log)].

Required Associated Types§

source

type Error: FailureMode

The actual error’s type in this failure.

Required Methods§

source

fn failure(self) -> Option<Self::Error>

The actual error in this failure, None if the failure isn’t a failure.

Provided Methods§

source

fn get_error( self, time: &Time, logged_errors: &mut LoggedErrors<Self> ) -> Option<Self::Error>where Self: Sized,

Get the error if it is ready to be logged.

Implementations on Foreign Types§

source§

impl Failure for Option<()>

§

type Error = &'static str

source§

fn failure(self) -> Option<Self::Error>

source§

impl<T: FailureMode> Failure for Result<(), T>

§

type Error = T

source§

fn failure(self) -> Option<Self::Error>

Implementors§