[][src]Function redis_protocol::decode::decode_bytes

pub fn decode_bytes(
    buf: &BytesMut
) -> Result<(Option<Frame>, usize), RedisProtocolError>

Attempt to parse the contents of buf, returning the first valid frame and the number of bytes consumed. If the byte slice contains an incomplete frame then None is returned.

The caller is responsible for consuming the underlying bytes.