SocketType

Trait SocketType 

Source
pub trait SocketType<'socket>: Default {
    // Required methods
    fn update_current_send_seq_num_for_event(
        &mut self,
        addr: &SocketAddr,
        event: &str,
    ) -> Option<SequenceNumber>;
    fn last_recv_seq_num_for_event(
        &'socket mut self,
        addr: &SocketAddr,
        event: &str,
    ) -> Option<&'socket mut SequenceNumber>;
}
Expand description

Used for the nautlis socket A socket must have a way to handle sequenced packets for clients. Otherwise, it will manage everything the same way

Required Methods§

Source

fn update_current_send_seq_num_for_event( &mut self, addr: &SocketAddr, event: &str, ) -> Option<SequenceNumber>

Updates the current sequence number for that specific event and should be handled on a per client basis

Source

fn last_recv_seq_num_for_event( &'socket mut self, addr: &SocketAddr, event: &str, ) -> Option<&'socket mut SequenceNumber>

Returns a mutable reference to the last received sequence number, it should be changed to the newest sequence number if the last received sequence number is lower

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'socket> SocketType<'socket> for NautClient

Source§

impl<'socket> SocketType<'socket> for NautServer