Struct AckUdp

Source
pub struct AckUdp {
    pub sock: Arc<UdpSocket>,
    pub ready_to_read_datagrams: Arc<Mutex<VecDeque<(SocketAddr, Vec<u8>)>>>,
    pub pending_in_datagrams: Arc<Mutex<HashMap<[u8; 5], AckUdpDatagram>>>,
    pub pending_out_datagrams: Arc<Mutex<HashMap<[u8; 5], AckUdpDatagram>>>,
    pub out_datagrams_status_links: Arc<Mutex<HashMap<[u8; 5], Arc<Mutex<AckUdpDatagramOutStatus>>>>>,
    pub kill_listener_channel_sender: Sender<()>,
    pub kill_income_checker_channel_sender: Sender<()>,
    pub kill_outcome_checker_listener_channel_sender: Sender<()>,
    pub kill_incoming_queue_channel_sender: Sender<()>,
    pub incoming_queue: Arc<Mutex<VecDeque<(SocketAddr, Vec<u8>)>>>,
}

Fields§

§sock: Arc<UdpSocket>§ready_to_read_datagrams: Arc<Mutex<VecDeque<(SocketAddr, Vec<u8>)>>>§pending_in_datagrams: Arc<Mutex<HashMap<[u8; 5], AckUdpDatagram>>>§pending_out_datagrams: Arc<Mutex<HashMap<[u8; 5], AckUdpDatagram>>>§out_datagrams_status_links: Arc<Mutex<HashMap<[u8; 5], Arc<Mutex<AckUdpDatagramOutStatus>>>>>§kill_listener_channel_sender: Sender<()>§kill_income_checker_channel_sender: Sender<()>§kill_outcome_checker_listener_channel_sender: Sender<()>§kill_incoming_queue_channel_sender: Sender<()>§incoming_queue: Arc<Mutex<VecDeque<(SocketAddr, Vec<u8>)>>>

Implementations§

Source§

impl AckUdp

Source

pub async fn check_dropped_income( income_checker_receiver: Receiver<()>, pending_in_datagrams: Arc<Mutex<HashMap<[u8; 5], AckUdpDatagram>>>, ) -> Result<()>

Source§

impl AckUdp

Source

pub async fn check_dropped_outcome( outcome_checker_receiver: Receiver<()>, pending_out_datagrams: Arc<Mutex<HashMap<[u8; 5], AckUdpDatagram>>>, socket: Arc<UdpSocket>, out_datagrams_status_links: Arc<Mutex<HashMap<[u8; 5], Arc<Mutex<AckUdpDatagramOutStatus>>>>>, )

Source§

impl AckUdp

Source

pub async fn listen_packets( listener_receiver: Receiver<()>, socket: Arc<UdpSocket>, incoming_queue: Arc<Mutex<VecDeque<(SocketAddr, Vec<u8>)>>>, )

Source§

impl AckUdp

Source

pub async fn process_packets( incoming_queue_receiver: Receiver<()>, incoming_queue: Arc<Mutex<VecDeque<(SocketAddr, Vec<u8>)>>>, socket: Arc<UdpSocket>, ready_to_read_datagrams: Arc<Mutex<VecDeque<(SocketAddr, Vec<u8>)>>>, pending_in_datagrams: Arc<Mutex<HashMap<[u8; 5], AckUdpDatagram>>>, pending_out_datagrams: Arc<Mutex<HashMap<[u8; 5], AckUdpDatagram>>>, out_datagrams_status_links: Arc<Mutex<HashMap<[u8; 5], Arc<Mutex<AckUdpDatagramOutStatus>>>>>, )

Source§

impl AckUdp

Source

pub async fn new(address: SocketAddr) -> Result<AckUdp>

Source

pub fn recv(&mut self) -> Option<(SocketAddr, Vec<u8>)>

Source

pub fn send( &mut self, buf: &[u8], address: SocketAddr, ) -> Result<Arc<Mutex<AckUdpDatagramOutStatus>>>

Auto Trait Implementations§

§

impl Freeze for AckUdp

§

impl !RefUnwindSafe for AckUdp

§

impl Send for AckUdp

§

impl Sync for AckUdp

§

impl Unpin for AckUdp

§

impl !UnwindSafe for AckUdp

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V