pub fn streaming(data: &[u8]) -> Result<Stream<'_>, Error>
Expand description

Decode data as packet line while reporting whether the data is complete or not using a Stream.

Examples found in repository?
src/decode.rs (line 141)
140
141
142
143
144
145
pub fn all_at_once(data: &[u8]) -> Result<PacketLineRef<'_>, Error> {
    match streaming(data)? {
        Stream::Complete { line, .. } => Ok(line),
        Stream::Incomplete { bytes_needed } => Err(Error::NotEnoughData { bytes_needed }),
    }
}