1
2
3
4
5
6
7
8
9
10
11
12
13
use std::pin::Pin;

use async_trait::async_trait;
use tokio::io::{AsyncRead, AsyncWrite};

pub type TDataReader = Pin<Box<dyn AsyncRead + Send + 'static>>;
pub type TDataWriter = Pin<Box<dyn AsyncWrite + Send + 'static>>;

#[async_trait]
pub trait Channel: AsyncRead + AsyncWrite + Send + Unpin + 'static {
    fn id(&self) -> u16;
    fn label(&self) -> &String;
}