Struct defmt::Debug2Format
source · pub struct Debug2Format<'a, T: Debug + ?Sized>(pub &'a T);
Expand description
An “adapter” type to feed Debug
values into defmt macros, which expect defmt::Format
values.
This adapter disables compression and uses the core::fmt
code on-device! You should prefer
defmt::Format
over Debug
whenever possible.
Examples
defmt::info!("{:?}", defmt::Debug2Format(&expensive_thing));
// ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
// must `#[derive(Debug)]`
Note that any provided defmt display hints will be ignored
because this always uses {:?}
to format the contained value.
Tuple Fields§
§0: &'a T
Trait Implementations§
Auto Trait Implementations§
impl<'a, T: ?Sized> RefUnwindSafe for Debug2Format<'a, T>where T: RefUnwindSafe,
impl<'a, T: ?Sized> Send for Debug2Format<'a, T>where T: Sync,
impl<'a, T: ?Sized> Sync for Debug2Format<'a, T>where T: Sync,
impl<'a, T: ?Sized> Unpin for Debug2Format<'a, T>
impl<'a, T: ?Sized> UnwindSafe for Debug2Format<'a, T>where T: RefUnwindSafe,
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