pub trait Loggable {
// Required method
fn to_message(self) -> Message;
}Expand description
Required Methods§
Sourcefn to_message(self) -> Message
fn to_message(self) -> Message
Converts the implementing type into a unified Message object.
Implementations on Foreign Types§
Source§impl<S: Into<Cow<'static, str>>> Loggable for (S, &'static str)
Implementation for static string slices.
This is the “Hot Path”—zero allocation is required for the message content.
impl<S: Into<Cow<'static, str>>> Loggable for (S, &'static str)
Implementation for static string slices. This is the “Hot Path”—zero allocation is required for the message content.
fn to_message(self) -> Message
Source§impl<S: Into<Cow<'static, str>>> Loggable for (S, &String)
Implementation for String references.
Performs a .clone() to satisfy the 'static requirement of the Logger.
impl<S: Into<Cow<'static, str>>> Loggable for (S, &String)
Implementation for String references.
Performs a .clone() to satisfy the 'static requirement of the Logger.
fn to_message(self) -> Message
Source§impl<S: Into<Cow<'static, str>>> Loggable for (S, Cow<'static, str>)
Implementation for Cow (Copy-on-Write) strings.
Handles both borrowed and owned data efficiently.
impl<S: Into<Cow<'static, str>>> Loggable for (S, Cow<'static, str>)
Implementation for Cow (Copy-on-Write) strings. Handles both borrowed and owned data efficiently.
fn to_message(self) -> Message
Source§impl<S: Into<Cow<'static, str>>> Loggable for (S, Value)
Available on crate feature json only.Implementation for structured JSON data.
Requires feature json.
impl<S: Into<Cow<'static, str>>> Loggable for (S, Value)
Available on crate feature
json only.Implementation for structured JSON data.
Requires feature json.
fn to_message(self) -> Message
Source§impl<S: Into<Cow<'static, str>>> Loggable for (S, Box<dyn Error + Send + Sync>)
Implementation for Standard Library Errors.
Wraps the error in a Box for rich exception logging.
impl<S: Into<Cow<'static, str>>> Loggable for (S, Box<dyn Error + Send + Sync>)
Implementation for Standard Library Errors.
Wraps the error in a Box for rich exception logging.
fn to_message(self) -> Message
Source§impl<S: Into<Cow<'static, str>>> Loggable for (S, String)
Implementation for owned Strings.
Takes ownership of the string, moving it into the Message without copying.
impl<S: Into<Cow<'static, str>>> Loggable for (S, String)
Implementation for owned Strings.
Takes ownership of the string, moving it into the Message without copying.