Skip to main content

read_length_prefixed

Function read_length_prefixed 

Source
pub async fn read_length_prefixed<R: AsyncReadExt + Unpin>(
    reader: &mut R,
    max: usize,
    reject_zero: bool,
) -> Result<Option<Vec<u8>>>
Expand description

Read one length-prefixed frame from a stream. Returns Ok(None) on clean EOF. Used to consume the MAVLink broadcast on the client side.