pub trait ResultExt<T> {
    fn context<K, V>(self, k: K, v: V) -> Result<T>
    where
        K: Into<Cow<'static, str>>,
        V: Into<Cow<'static, str>>
; fn context_with<F>(self, f: F) -> Result<T>
    where
        F: FnOnce() -> (String, String)
; fn frame(self) -> Result<T>; fn frame_with<F>(self, f: F) -> Result<T>
    where
        F: FnOnce() -> String
; fn frame_with_name<N>(self, name: N) -> Result<T>
    where
        N: Into<Cow<'static, str>>
; }
Expand description

Result extension

Required Methods

Appends key, value pair to context of the last frame

Arguments
  • k - A key
  • v - A value

Appends key, value pair to context of the last frame

Arguments
  • f - A function which must return tuple (key, value)

Appends new, anonymous, frame

Anonymous means that the frame does not have a name.

Appends new frame

Arguments
  • f - A function which must return frame name

Appends new frame

Arguments
  • name - A frame name

Implementors