use std::io; use getset::Getters; // TODO : better error type for protocol violation pub type ProtocolViolation = String; pub enum DisconnectReason { Normal, Error(io::Error), ProtocolError(ProtocolViolation), Timeout, ServerShutdown, } #[derive(Getters)] pub struct DisconnectEvent where Uid: PartialEq, { #[getset(get = "pub")] connection_id: Uid, #[getset(get = "pub")] reason: DisconnectReason, }