netmod-tcp 0.4.0

An internet overlay netmod endpoint driver
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Handle an Io pair channel

use async_std::channel::{bounded, Receiver, Sender};
static CHANNEL_WIDTH: usize = 3;

#[derive(Debug)]
pub(crate) struct IoPair<T> {
    pub(crate) rx: Receiver<T>,
    pub(crate) tx: Sender<T>,
}

impl<T> Default for IoPair<T> {
    fn default() -> Self {
        let (tx, rx) = bounded(CHANNEL_WIDTH);
        Self { tx, rx }
    }
}