#[non_exhaustive]pub enum FormatterFormat<'a> {
Default {
with_location: bool,
},
OneLine {
with_location: bool,
},
Custom(&'a str),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Default
The classic defmt two-line format.
Looks like:
INFO This is a log message
└─ test_lib::hello @ /Users/jonathan/Documents/knurling/test-lib/src/lib.rs:8OneLine
A one-line format.
Looks like:
[INFO ] This is a log message (crate_name test-lib/src/lib.rs:8)Custom(&'a str)
Implementations§
Source§impl FormatterFormat<'static>
impl FormatterFormat<'static>
Sourcepub fn from_string(
s: &str,
with_location: bool,
) -> Option<FormatterFormat<'static>>
pub fn from_string( s: &str, with_location: bool, ) -> Option<FormatterFormat<'static>>
Parse a string into a choice of FormatterFormat.
Unknown strings return None.
Sourcepub fn get_options() -> impl Iterator<Item = &'static str>
pub fn get_options() -> impl Iterator<Item = &'static str>
Get a list of valid string names for the various format options.
This will not include an entry for FormatterFormat::Custom because
that requires a format string argument.
Trait Implementations§
Source§impl<'a> Debug for FormatterFormat<'a>
impl<'a> Debug for FormatterFormat<'a>
Auto Trait Implementations§
impl<'a> Freeze for FormatterFormat<'a>
impl<'a> RefUnwindSafe for FormatterFormat<'a>
impl<'a> Send for FormatterFormat<'a>
impl<'a> Sync for FormatterFormat<'a>
impl<'a> Unpin for FormatterFormat<'a>
impl<'a> UnwindSafe for FormatterFormat<'a>
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