Trait termwiz::error::Context [−][src]
This trait allows extending the Result type so that it can create a
termwiz::Error
that wraps an underlying other error and provide
additional context on that error.
Required methods
fn context<C>(self, context: C) -> Result<T> where
C: Display + Send + Sync + 'static,
[src]
C: Display + Send + Sync + 'static,
Wrap the error value with additional context.
fn with_context<C, F>(self, f: F) -> Result<T> where
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
[src]
C: Display + Send + Sync + 'static,
F: FnOnce() -> C,
Wrap the error value with additional context that is evaluated lazily only once an error does occur.
Implementations on Foreign Types
impl<T, E> Context<T, E> for Result<T, E> where
E: Error + Send + Sync + 'static,
[src]
E: Error + Send + Sync + 'static,
fn context<C>(self, context: C) -> Result<T> where
C: Display + Send + Sync + 'static,
[src]
C: Display + Send + Sync + 'static,
fn with_context<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,