Trait SiftError

Source
pub trait SiftError<T, C>
where C: Display + Send + Sync + 'static,
{ // Required methods fn context(self, ctx: C) -> Result<T>; fn with_context<F>(self, op: F) -> Result<T> where F: Fn() -> C; fn help(self, txt: C) -> Result<T>; }
Expand description

Trait that defines the behavior of errors that Sift manages.

Required Methods§

Source

fn context(self, ctx: C) -> Result<T>

Adds context that is printed with the error.

Source

fn with_context<F>(self, op: F) -> Result<T>
where F: Fn() -> C,

Like context but takes in a closure.

Source

fn help(self, txt: C) -> Result<T>

User-help text.

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.

Implementors§

Source§

impl<T, C> SiftError<T, C> for Result<T>
where C: Display + Send + Sync + 'static,