Trait loga::ResultContext
source · pub trait ResultContext<O> {
// Required methods
fn context(self, message: &'static str) -> Result<O, Error>;
fn context_with(
self,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
) -> Result<O, Error>;
fn log_context(self, log: &Log, message: &'static str) -> Result<O, Error>;
fn log_context_with(
self,
log: &Log,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
) -> Result<O, Error>;
fn warn(self, log: &Log, message: &'static str);
fn warn_with(
self,
log: &Log,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
);
}Required Methods§
sourcefn context(self, message: &'static str) -> Result<O, Error>
fn context(self, message: &'static str) -> Result<O, Error>
If the value is Err/None, add a simple context string onto an error, converting
it to loga::Error in the process.
sourcefn context_with(
self,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
) -> Result<O, Error>
fn context_with( self, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) ) -> Result<O, Error>
If the value is Err/None, add a simple context string and attributes pairs onto
an error, converting it to loga::Error in the process.
sourcefn log_context(self, log: &Log, message: &'static str) -> Result<O, Error>
fn log_context(self, log: &Log, message: &'static str) -> Result<O, Error>
If the value is Err/None, add attributes from the log as well as a simple
context string to an error, converting it to loga::Error in the process.
sourcefn log_context_with(
self,
log: &Log,
message: &'static str,
attrs: impl Fn(&mut HashMap<&'static str, String>)
) -> Result<O, Error>
fn log_context_with( self, log: &Log, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) ) -> Result<O, Error>
If the value is Err/None, add attributes from the log as well as the specified
attributes and a simple context string to an error, converting it to
loga::Error in the process.
fn warn(self, log: &Log, message: &'static str)
fn warn_with( self, log: &Log, message: &'static str, attrs: impl Fn(&mut HashMap<&'static str, String>) )
Object Safety§
This trait is not object safe.