Struct naia_shared::MessageManager
source · [−]pub struct MessageManager<P: ProtocolType> { /* private fields */ }Expand description
Handles incoming/outgoing messages, tracks the delivery status of Messages so that guaranteed Messages can be re-transmitted to the remote host
Implementations
Returns whether the Manager has queued Messages that can be transmitted to the remote host
Gets the next queued Message to be transmitted
If the last popped Message from the queue somehow wasn’t able to be written into a packet, put the Message back into the front of the queue
pub fn queue_outgoing_message<R: ReplicateSafe<P>>(
&mut self,
message: &R,
guaranteed_delivery: bool
)
pub fn queue_outgoing_message<R: ReplicateSafe<P>>(
&mut self,
message: &R,
guaranteed_delivery: bool
)
Queues an Message to be transmitted to the remote host
Returns whether any Messages have been received that must be handed to the application
Get the most recently received Message
pub fn process_data(
&mut self,
reader: &mut PacketReader<'_>,
manifest: &Manifest<P>,
packet_index: u16
)
pub fn process_data(
&mut self,
reader: &mut PacketReader<'_>,
manifest: &Manifest<P>,
packet_index: u16
)
Given incoming packet data, read transmitted Messages and store them to be returned to the application
Trait Implementations
Occurs when a packet has been notified as delivered. Stops tracking the status of Messages in that packet.
Occurs when a packet has been notified as having been dropped. Queues up any guaranteed Messages that were lost in the packet for retransmission.