use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub struct SessionKey(pub uuid::Uuid);
#[cfg(feature = "uuid-v4")]
impl SessionKey {
#[cfg_attr(docsrs, doc(cfg(feature = "uuid-v4")))]
pub fn new() -> Self {
SessionKey(uuid::Uuid::new_v4())
}
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, Eq, PartialEq, Hash)]
pub struct ConnectionKey {
pub addr: std::net::SocketAddr,
}
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
pub enum AccessToken {
NoToken,
PreSharedToken(String),
}