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
use crate::common::{Serialize, SerializePdu, SupportedVersion};
use crate::resupply_cancel::model::ResupplyCancel;
use bytes::BytesMut;

impl SerializePdu for ResupplyCancel {
    fn serialize_pdu(&self, _version: SupportedVersion, buf: &mut BytesMut) -> u16 {
        let requesting_id_bytes = self.requesting_id.serialize(buf);
        let servicing_id_bytes = self.servicing_id.serialize(buf);

        requesting_id_bytes + servicing_id_bytes
    }
}