Struct string_telephone::shared::SequenceManager [-]  [+] [src]

pub struct SequenceManager {
    pub last_sent_sequence_id: u16,
    pub last_received_sequence_id: u16,
}

A helper struct to maintain packet ordering and acks

Fields

last_sent_sequence_id
last_received_sequence_id

Methods

impl SequenceManager

fn new() -> SequenceManager

Create a new SequenceManager

fn next_sequence_id(&mut self) -> u16

Generate a new sequence ID for us

fn packet_is_newer(&self, sequence_id: u16) -> bool

Is a packet classed as newer than the last we received?

fn set_newest_packet(&mut self, sequence_id: u16)

Set the last packet we received

Trait Implementations

Derived Implementations

impl Clone for SequenceManager

fn clone(&self) -> SequenceManager

fn clone_from(&mut self, source: &Self)