pub struct LogDisplay<'a, T: ?Sized>(pub &'a T);Expand description
Logs T through its Display impl in every destination, defmt included
(via defmt::Display2Format).
For a foreign type that does not implement defmt::Format in a log_*!
call: log_warn!("send failed: {}", LogDisplay(&e)). The tracing and
log output is unchanged; under defmt the text is formatted on the
device, not interned, so keep it to error paths.
Tuple Fields§
§0: &'a TTrait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for LogDisplay<'a, T>
impl<'a, T> RefUnwindSafe for LogDisplay<'a, T>
impl<'a, T> Send for LogDisplay<'a, T>
impl<'a, T> Sync for LogDisplay<'a, T>
impl<'a, T> Unpin for LogDisplay<'a, T>
impl<'a, T> UnsafeUnpin for LogDisplay<'a, T>
impl<'a, T> UnwindSafe for LogDisplay<'a, T>
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