Skip to main content

ErrorRecovery

Trait ErrorRecovery 

Source
pub trait ErrorRecovery {
    // Required methods
    fn suggest_fixes(&self) -> Vec<String>;
    fn can_auto_recover(&self) -> bool;
    fn attempt_recovery(&self) -> Result<Option<Box<dyn Any>>, Error>;
    fn error_context(&self) -> Option<&ErrorContext>;
}
Expand description

Trait for error recovery and suggestion

Required Methods§

Source

fn suggest_fixes(&self) -> Vec<String>

Suggest fixes for the error

Source

fn can_auto_recover(&self) -> bool

Check if error can be automatically recovered

Source

fn attempt_recovery(&self) -> Result<Option<Box<dyn Any>>, Error>

Attempt automatic recovery (returns recovered data or new error)

Source

fn error_context(&self) -> Option<&ErrorContext>

Get error context

Implementors§