use std::sync::Arc;
use crate::{message::Message, Details};
use async_trait::async_trait;
use super::connections::UserCon;
#[async_trait]
pub trait Receiver {
type ReceivingError: std::fmt::Debug;
async fn recv_msg(&mut self) -> Result<Message, Self::ReceivingError>;
}
#[async_trait]
pub trait Sender {
type SendingError: std::fmt::Debug;
async fn send_msg(&self, data: Vec<u8>, length: u64) -> Result<(), Self::SendingError>;
}
#[async_trait]
pub trait Handler {
async fn new_con(self: Arc<Self>, id: u32, details: Details, con: UserCon);
}