Function rumqttc_async_std::check[][src]

pub fn check(
    stream: Iter<'_, u8>,
    max_packet_size: usize
) -> Result<FixedHeader, Error>

Checks if the stream has enough bytes to frame a packet and returns fixed header only if a packet can be framed with existing bytes in the stream. The passed stream doesn't modify parent stream's cursor. If this function returned an error, next check on the same parent stream is forced start with cursor at 0 again (Iter is owned. Only Iter's cursor is changed internally)