pub fn encoded_len<N>(num: N) -> usizewhere N: PrimInt + Unsigned,
Get the number of bytes needed to encode num
num
let len = encoded_len(0x4000_u16); assert_eq!(len, 3);