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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::common::model::PduBody;
use crate::common::parser::entity_id;
use crate::resupply_cancel::model::ResupplyCancel;
use crate::BodyRaw;
use nom::IResult;

pub(crate) fn resupply_cancel_body(input: &[u8]) -> IResult<&[u8], PduBody> {
    let (input, requesting_id) = entity_id(input)?;
    let (input, servicing_id) = entity_id(input)?;

    let body = ResupplyCancel::builder()
        .with_requesting_id(requesting_id)
        .with_servicing_id(servicing_id)
        .build();

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