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§
Sourcefn suggest_fixes(&self) -> Vec<String>
fn suggest_fixes(&self) -> Vec<String>
Suggest fixes for the error
Sourcefn can_auto_recover(&self) -> bool
fn can_auto_recover(&self) -> bool
Check if error can be automatically recovered
Sourcefn attempt_recovery(&self) -> Result<Option<Box<dyn Any>>, Error>
fn attempt_recovery(&self) -> Result<Option<Box<dyn Any>>, Error>
Attempt automatic recovery (returns recovered data or new error)
Sourcefn error_context(&self) -> Option<&ErrorContext>
fn error_context(&self) -> Option<&ErrorContext>
Get error context