decoded_lengths

Function decoded_lengths 

Source
pub fn decoded_lengths(bytes: &[u8]) -> Result<Vec<usize>>
Expand description

Determine the decoded length of each SLIP frame in the provided input without materialising the payloads.

use slipstream::{decoded_lengths, encode_frame};

let encoded = [encode_frame(b"hi"), encode_frame(&[])].concat();
assert_eq!(decoded_lengths(&encoded).unwrap(), vec![2, 0]);