pub struct Frame<'t> { /* private fields */ }Expand description
A log frame
Implementations§
Source§impl<'t> Frame<'t>
impl<'t> Frame<'t>
Sourcepub fn display(&'t self, colored: bool) -> DisplayFrame<'t>
pub fn display(&'t self, colored: bool) -> DisplayFrame<'t>
Returns a struct that will format this log frame (including message, timestamp, level, etc.).
pub fn display_timestamp(&'t self) -> Option<DisplayTimestamp<'t>>
Sourcepub fn display_message(&'t self) -> DisplayMessage<'t>
pub fn display_message(&'t self) -> DisplayMessage<'t>
Returns a struct that will format the message contained in this log frame.
Sourcepub fn display_fragments(&'t self) -> DisplayFragments<'t>
pub fn display_fragments(&'t self) -> DisplayFragments<'t>
Returns an iterator over the fragments of the message contained in this log frame.
Collecting this into a String will yield the same result as Self::display_message, but
this iterator will yield interpolated fragments on their own. For example, the log:
defmt::info!("foo = {}, bar = {}", 1, 2);Will yield the following strings:
vec!["foo = ", "1", ", bar = ", "2"]Note that nested fragments will not yield separately:
defmt::info!("foo = {}", Foo { bar: 1 });Will yield:
vec!["foo = ", "Foo { bar: 1 }"]This iterator yields the same fragments as Self::fragments, so you can zip them
together to get both representations.
Sourcepub fn fragments(&'t self) -> Vec<Fragment<'t>>
pub fn fragments(&'t self) -> Vec<Fragment<'t>>
Returns the fragments of the message contained in this log frame.
Each fragment represents a part of the log message. See Fragment for more details.
This iterator yields the same fragments as Self::display_fragments, so you can zip them
together to get both representations.