[−][src]Trait color_eyre::Help
A helper trait for attaching help text to errors to be displayed after the chain of errors
Required methods
fn note<C>(self, context: C) -> Result<T> where
C: Display + Send + Sync + 'static,
C: Display + Send + Sync + 'static,
Add a note to an error, to be displayed after the chain of errors.
Examples
use color_eyre::Help as _; fallible_fn().note("This might have failed due to ...")?;
fn with_note<C, F>(self, f: F) -> Result<T> where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
Add a Note to an error, to be displayed after the chain of errors, which is lazily evaluated only in the case of an error.
Examples
use color_eyre::Help as _; fallible_fn().with_note(|| { format!("This might have failed due to ... It has failed {} times", 100) })?;
fn warning<C>(self, context: C) -> Result<T> where
C: Display + Send + Sync + 'static,
C: Display + Send + Sync + 'static,
Add a Warning to an error, to be displayed after the chain of errors.
fn with_warning<C, F>(self, f: F) -> Result<T> where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
Add a Warning to an error, to be displayed after the chain of errors, which is lazily evaluated only in the case of an error.
fn suggestion<C>(self, context: C) -> Result<T> where
C: Display + Send + Sync + 'static,
C: Display + Send + Sync + 'static,
Add a Suggestion to an error, to be displayed after the chain of errors.
fn with_suggestion<C, F>(self, f: F) -> Result<T> where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
Add a Suggestion to an error, to be displayed after the chain of errors, which is lazily evaluated only in the case of an error.
Implementations on Foreign Types
impl<T, E> Help<T> for Result<T, E> where
E: Into<Report>,
[src]
E: Into<Report>,
fn note<C>(self, context: C) -> Result<T> where
C: Display + Send + Sync + 'static,
[src]
C: Display + Send + Sync + 'static,
fn with_note<C, F>(self, context: F) -> Result<T> where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
[src]
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
fn warning<C>(self, context: C) -> Result<T> where
C: Display + Send + Sync + 'static,
[src]
C: Display + Send + Sync + 'static,
fn with_warning<C, F>(self, context: F) -> Result<T> where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
[src]
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
fn suggestion<C>(self, context: C) -> Result<T> where
C: Display + Send + Sync + 'static,
[src]
C: Display + Send + Sync + 'static,
fn with_suggestion<C, F>(self, context: F) -> Result<T> where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
[src]
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,