Trait balena_temen::error::ResultExt
source · 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
sourcefn context<K, V>(self, k: K, v: V) -> Result<T>where
K: Into<Cow<'static, str>>,
V: Into<Cow<'static, str>>,
fn context<K, V>(self, k: K, v: V) -> Result<T>where
K: Into<Cow<'static, str>>,
V: Into<Cow<'static, str>>,
sourcefn context_with<F>(self, f: F) -> Result<T>where
F: FnOnce() -> (String, String),
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)
sourcefn frame(self) -> Result<T>
fn frame(self) -> Result<T>
Appends new, anonymous, frame
Anonymous means that the frame does not have a name.