decode_frames_with_remainder

Function decode_frames_with_remainder 

Source
pub fn decode_frames_with_remainder(
    bytes: &[u8],
) -> Result<(Vec<Vec<u8>>, FrameRemainder)>
Expand description

Decode SLIP frames and also return any buffered remainder when the input ends without a trailing END.

use slipstream::{decode_frames_with_remainder, encode_frame};

let mut truncated = encode_frame(b"hi");
truncated.pop();
let (frames, remainder) = decode_frames_with_remainder(&truncated).unwrap();
assert!(frames.is_empty());
assert_eq!(remainder.decoded, b"hi");
assert!(!remainder.escape_pending);