pub trait ContextExt<T> {
// Required methods
fn context(self, message: impl Into<Cow<'static, str>>) -> TestResult<T>;
fn with_context<F, S>(self, f: F) -> TestResult<T>
where F: FnOnce() -> S,
S: Into<Cow<'static, str>>;
}Required Methods§
Sourcefn context(self, message: impl Into<Cow<'static, str>>) -> TestResult<T>
fn context(self, message: impl Into<Cow<'static, str>>) -> TestResult<T>
Adds a context frame describing the operation that was being attempted.
On the success path the value is returned unchanged.
Sourcefn with_context<F, S>(self, f: F) -> TestResult<T>
fn with_context<F, S>(self, f: F) -> TestResult<T>
Like context, but the message is computed by
f, which runs only on the failure path.
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.