Struct Hex
pub struct Hex<T>(pub T)
where
T: AsRef<[u8]>;Expand description
A newtype around byte slices used for all of Ariel OS’s logging facades that turns the bytes into some hex output.
Its preferred output is 00 11 22 33, but log facades may also produce something like [00, 11, 22, 33] (eg. while that is cheaper on defmt).
Instead of writing some variation of info!("Found bytes {:02x}", data), you can write
info!("Found bytes {}", Hex(data)).
Tuple Fields§
§0: TTrait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Hex<T>where
T: Freeze,
impl<T> RefUnwindSafe for Hex<T>where
T: RefUnwindSafe,
impl<T> Send for Hex<T>where
T: Send,
impl<T> Sync for Hex<T>where
T: Sync,
impl<T> Unpin for Hex<T>where
T: Unpin,
impl<T> UnwindSafe for Hex<T>where
T: UnwindSafe,
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