pub struct StringMessageImpl { /* private fields */ }Expand description
A standard text-based log message.
Uses Cow<'static, str> to avoid heap allocations when using static string literals.
Implementations§
Source§impl StringMessageImpl
impl StringMessageImpl
Sourcepub fn get_string(&self) -> &str
pub fn get_string(&self) -> &str
Returns a reference to the underlying string content.
Trait Implementations§
Source§impl MessageImpl for StringMessageImpl
impl MessageImpl for StringMessageImpl
Source§fn level(&self) -> &dyn Display
fn level(&self) -> &dyn Display
Returns the log level (e.g., “INFO”, “DEBUG”) as a displayable object.
Using
&dyn Display ensures zero-copy for static string levels.Source§fn content(&self) -> &dyn Display
fn content(&self) -> &dyn Display
Returns the message body content.
This allows for deferred formatting of complex types like JSON or Error objects.
Source§fn instant(&self) -> SystemTime
fn instant(&self) -> SystemTime
Returns the exact SystemTime when the message was created.
Crucial for maintaining chronological order in asynchronous logging.
Auto Trait Implementations§
impl Freeze for StringMessageImpl
impl RefUnwindSafe for StringMessageImpl
impl Send for StringMessageImpl
impl Sync for StringMessageImpl
impl Unpin for StringMessageImpl
impl UnwindSafe for StringMessageImpl
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.