dis-rs 0.13.0

An implementation of the Distributed Interactive Simulation protocol (IEEE-1278.1) in Rust. This main crate contains PDU implementations and facilities to read/write PDUs from Rust data structures to the wire format and vice versa. It supports versions 6 and 7 of the protocol.
Documentation
use crate::comment_r::model::CommentR;
use crate::common::model::PduBody;
use crate::common::parser::{datum_specification, entity_id};
use crate::BodyRaw;
use nom::IResult;

pub(crate) fn comment_r_body(input: &[u8]) -> IResult<&[u8], PduBody> {
    let (input, originating_id) = entity_id(input)?;
    let (input, receiving_id) = entity_id(input)?;
    let (input, datums) = datum_specification(input)?;

    let body = CommentR::builder()
        .with_origination_id(originating_id)
        .with_receiving_id(receiving_id)
        .with_variable_datums(datums.variable_datum_records)
        .build();

    Ok((input, body.into_pdu_body()))
}