pub trait ErrContext<T, E>: Sealed {
Show 15 methods
// Required methods
fn error_context(self, context: impl Display) -> Result<T, E>;
fn warn_context(self, context: impl Display) -> Result<T, E>;
fn info_context(self, context: impl Display) -> Result<T, E>;
fn debug_context(self, context: impl Display) -> Result<T, E>;
fn trace_context(self, context: impl Display) -> Result<T, E>;
fn with_error_context<F, D>(self, f: F) -> Result<T, E>
where F: FnOnce(&E) -> D,
D: Display;
fn with_warn_context<F, D>(self, f: F) -> Result<T, E>
where F: FnOnce(&E) -> D,
D: Display;
fn with_info_context<F, D>(self, f: F) -> Result<T, E>
where F: FnOnce(&E) -> D,
D: Display;
fn with_debug_context<F, D>(self, f: F) -> Result<T, E>
where F: FnOnce(&E) -> D,
D: Display;
fn with_trace_context<F, D>(self, f: F) -> Result<T, E>
where F: FnOnce(&E) -> D,
D: Display;
fn consume_with_error<F, D>(self, f: F) -> Option<T>
where F: FnOnce(&E) -> D,
D: Display;
fn consume_with_warn<F, D>(self, f: F) -> Option<T>
where F: FnOnce(&E) -> D,
D: Display;
fn consume_with_info<F, D>(self, f: F) -> Option<T>
where F: FnOnce(&E) -> D,
D: Display;
fn consume_with_debug<F, D>(self, f: F) -> Option<T>
where F: FnOnce(&E) -> D,
D: Display;
fn consume_with_trace<F, D>(self, f: F) -> Option<T>
where F: FnOnce(&E) -> D,
D: Display;
}
Required Methods§
Sourcefn error_context(self, context: impl Display) -> Result<T, E>
fn error_context(self, context: impl Display) -> Result<T, E>
If Err, logging context as an “error”.
Sourcefn warn_context(self, context: impl Display) -> Result<T, E>
fn warn_context(self, context: impl Display) -> Result<T, E>
If Err, logging context as a “warn”.
Sourcefn info_context(self, context: impl Display) -> Result<T, E>
fn info_context(self, context: impl Display) -> Result<T, E>
If Err, logging context as an “info”.
Sourcefn debug_context(self, context: impl Display) -> Result<T, E>
fn debug_context(self, context: impl Display) -> Result<T, E>
If Err, logging context as a “debug”.
Sourcefn trace_context(self, context: impl Display) -> Result<T, E>
fn trace_context(self, context: impl Display) -> Result<T, E>
If Err, logging context as a “trace”.
Sourcefn with_error_context<F, D>(self, f: F) -> Result<T, E>
fn with_error_context<F, D>(self, f: F) -> Result<T, E>
If Err, lazily logging the result of [f] as an “error”.
Sourcefn with_warn_context<F, D>(self, f: F) -> Result<T, E>
fn with_warn_context<F, D>(self, f: F) -> Result<T, E>
If Err, lazily logging the result of [f] as a “warn”.
Sourcefn with_info_context<F, D>(self, f: F) -> Result<T, E>
fn with_info_context<F, D>(self, f: F) -> Result<T, E>
If Err, lazily logging the result of [f] as an “info”.
Sourcefn with_debug_context<F, D>(self, f: F) -> Result<T, E>
fn with_debug_context<F, D>(self, f: F) -> Result<T, E>
If Err, lazily logging the result of [f] as a “debug”.
Sourcefn with_trace_context<F, D>(self, f: F) -> Result<T, E>
fn with_trace_context<F, D>(self, f: F) -> Result<T, E>
If Err, lazily logging the result of [f] as a “trace”.
Sourcefn consume_with_error<F, D>(self, f: F) -> Option<T>
fn consume_with_error<F, D>(self, f: F) -> Option<T>
Sourcefn consume_with_warn<F, D>(self, f: F) -> Option<T>
fn consume_with_warn<F, D>(self, f: F) -> Option<T>
Sourcefn consume_with_info<F, D>(self, f: F) -> Option<T>
fn consume_with_info<F, D>(self, f: F) -> Option<T>
Sourcefn consume_with_debug<F, D>(self, f: F) -> Option<T>
fn consume_with_debug<F, D>(self, f: F) -> Option<T>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.