pub fn streaming(data: &[u8]) -> Result<Stream<'_>, Error>
Decode data as packet line while reporting whether the data is complete or not using a Stream.
data
Stream
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 }), } }