[][src]Trait balena_temen::error::ResultExt

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>>
; }

Result extension

Required methods

fn context<K, V>(self, k: K, v: V) -> Result<T> where
    K: Into<Cow<'static, str>>,
    V: Into<Cow<'static, str>>, 

Appends key, value pair to context of the last frame

Arguments

  • k - A key
  • v - A value

fn context_with<F>(self, f: F) -> Result<T> where
    F: FnOnce() -> (String, String)

Appends key, value pair to context of the last frame

Arguments

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

fn frame(self) -> Result<T>

Appends new, anonymous, frame

Anonymous means that the frame does not have a name.

fn frame_with<F>(self, f: F) -> Result<T> where
    F: FnOnce() -> String

Appends new frame

Arguments

  • f - A function which must return frame name

fn frame_with_name<N>(self, name: N) -> Result<T> where
    N: Into<Cow<'static, str>>, 

Appends new frame

Arguments

  • name - A frame name
Loading content...

Implementors

impl<T> ResultExt<T> for Result<T>[src]

Loading content...