use std::fmt;
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
pub struct SessionId(pub u32);
impl SessionId {
pub fn new(id: u32) -> Self {
Self(id)
}
pub fn id(&self) -> u32 {
self.0
}
}
impl fmt::Display for SessionId {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum ConnectionSide {
Connector,
Listener,
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum Direction {
Incoming,
Outgoing,
}