1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*!
Module to group messages into packets
# Packet
This module defines the concept of a [`Packet`] which is a byte array that will be sent over the network.
A [`Packet`] has a maximum size that depends on the transport (around 1400 bytes for UDP), and is
composed of a header and a payload.
The header will compute important information such as the packet sequence number, the packet type, etc.
as well as information to handle the ack system.
The payload is a list of messages that are included in the packet. Messages will be included in the packet
in order of [`Channel`] priority.
Packets that are over the maximum packet size will be fragmented into multiple [`FragmentedPacket`].
[`Packet`]: packet::Packet
[`Channel`]: crate::channel::builder::Channel
[`FragmentedPacket`]: packet::FragmentedPacket
*/
/// Manages the [`PacketHeader`](header::PacketHeader) which includes important packet information
/// Defines the [`Message`](message::Message) struct, which is a piece of serializable data
/// Manages sending and receiving [`Packets`](packet::Packet) over the network
/// Defines the [`Packet`](packet::Packet) struct
/// Manages building a single [`Packet`](packet::Packet) from multiple [`Messages`](message::Message)
pub
/// Defines the [`PacketType`](packet_type::PacketType) enum
pub