mod serial;
mod tcp_client;
mod tcp_server;
mod udp_client;
mod udp_server;

pub use serial::Serial;
use std::io;
use std::sync::Arc;
pub use tcp_client::TcpClient;
pub use tcp_server::TcpServer;
pub use udp_client::UdpClient;
pub use udp_server::UdpServer;

#[async_trait::async_trait]
pub trait LinkTrait {
    async fn send(&mut self, msg: &[u8]) -> io::Result<()>;
    async fn recv(&mut self) -> io::Result<Arc<Vec<u8>>>;
}