pub struct Pretty<'a>(pub &'a [u8]);Expand description
Formats a TLV encoding in the notation of Core Appendix A.
use matter_kit::tlv::Pretty;
let bytes = [0x15, 0x20, 0x00, 0x2a, 0x20, 0x01, 0xef, 0x18];
assert_eq!(std::format!("{}", Pretty(&bytes)), "{0 = 42, 1 = -17}");Malformed input does not fail the format call — it prints what it understood and then
<!error>, because a formatter that refuses to print a broken message is useless
exactly when a broken message is what you have.
Tuple Fields§
§0: &'a [u8]Trait Implementations§
impl<'a> Copy for Pretty<'a>
Auto Trait Implementations§
impl<'a> Forget for Pretty<'a>
impl<'a> Freeze for Pretty<'a>
impl<'a> Move for Pretty<'a>
impl<'a> RefUnwindSafe for Pretty<'a>
impl<'a> Send for Pretty<'a>
impl<'a> Sync for Pretty<'a>
impl<'a> Unpin for Pretty<'a>
impl<'a> UnsafeUnpin for Pretty<'a>
impl<'a> UnwindSafe for Pretty<'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