1#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
4pub enum ServerError {
5 AddrBindErr,
7 AlreadyOnline,
9 NotListening,
11 Killed,
13 Reset,
15}
16
17impl std::fmt::Display for ServerError {
18 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
19 write!(
20 f,
21 "{}",
22 match self {
23 ServerError::AddrBindErr => "Unable to bind to address",
24 ServerError::AlreadyOnline => "Already online",
25 ServerError::NotListening => "Not listening",
26 ServerError::Killed => "Killed",
27 ServerError::Reset => "Reset",
28 }
29 )
30 }
31}
32
33impl std::error::Error for ServerError {}