pub type Sender = tokio::sync::broadcast::Sender; pub type Receiver = tokio::sync::broadcast::Receiver; #[derive(Clone, Debug, Eq, PartialEq, Hash)] pub struct Link(String); impl From for Link where S: Into { fn from(value: S) -> Self { Self(value.into()) } } #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct Id(usize); impl Id { pub const fn new(n: usize) -> Self { Self(n) } } #[derive(Clone, Debug)] pub struct Message { pub origin: (Id, String), pub link: Link, pub author: String, pub content: String, }