Skip to main content

encode

Function encode 

Source
pub fn encode(items: &[Tlv<'_>], out: &mut [u8]) -> Result<usize, TlvError>
Expand description

Encode a sequence of BER-TLV objects into out, returning the number of bytes written. TlvError::Overflow if out is too small (the caller sizes the scratch — typically a command data field ≤ 255 B).

§Errors

Returns TlvError::Overflow if out is too small to hold the encoded objects.