pub struct PrettyIn<'a>(pub &'a [u8], pub ContainerKind);Expand description
Formats a TLV fragment — one or more members of a container, rather than a complete top-level encoding.
Which tag forms are legal depends on where an element sits, so a fragment carrying a
context-specific tag is valid inside a structure and invalid on its own.
Pretty reads at the top level and would print <!error> for exactly the bytes that
are correct; this reads them the way they will be read.
The counterpart of TlvReader::new_in and
TlvWriter::new_in.
use matter_kit::tlv::{ContainerKind, PrettyIn};
// An attribute value destined for an AttributeDataIB's context-2 slot.
let bytes = [0x24, 0x02, 0x2A];
assert_eq!(
std::format!("{}", PrettyIn(&bytes, ContainerKind::Structure)),
"2 = 42U"
);Tuple Fields§
§0: &'a [u8]§1: ContainerKindTrait Implementations§
impl<'a> Copy for PrettyIn<'a>
Auto Trait Implementations§
impl<'a> Forget for PrettyIn<'a>
impl<'a> Freeze for PrettyIn<'a>
impl<'a> Move for PrettyIn<'a>
impl<'a> RefUnwindSafe for PrettyIn<'a>
impl<'a> Send for PrettyIn<'a>
impl<'a> Sync for PrettyIn<'a>
impl<'a> Unpin for PrettyIn<'a>
impl<'a> UnsafeUnpin for PrettyIn<'a>
impl<'a> UnwindSafe for PrettyIn<'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