Skip to main content

frame_length

Function frame_length 

Source
pub fn frame_length(buf: &[u8]) -> Result<Option<usize>, DecodeError>
Expand description

If buf begins with at least one complete FIX message, return Ok(Some(total_len)) (the byte length of that message). Return Ok(None) if more bytes are needed, or Err if the start of the buffer cannot be framed (including a declared BodyLength beyond MAX_BODY_LEN).

Uses BodyLength (tag 9) to locate the body, then accounts for the fixed 7-byte 10=XXX<SOH> CheckSum trailer.