A PacketParts struct decomposes a packet into its components:
let parts = PacketParts::new(id, correlation_id, payload);id: u32— envelope identifier used for routing (packetin trait abstraction contexts)correlation_id: Option<u64>—Nonemarks an unsolicited event or server‑initiated pushpayload: Vec<u8>— raw message bytes
Custom packet types can convert to and from PacketParts to avoid manual
mapping:
let parts = PacketParts::new(id, None, data);
let env = Envelope::from(parts);None propagation ensures packets that originate on the server carry no
accidental correlation identifier.