Add Display for CloseReason
This commit is contained in:
parent
8837d1c6c3
commit
bcc44fa10e
@ -19,6 +19,18 @@ pub enum CloseReason {
|
|||||||
SelfClosed,
|
SelfClosed,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Display for CloseReason {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
match self {
|
||||||
|
CloseReason::NotAcceptingConnections => write!(f, "Not accepting new connections"),
|
||||||
|
CloseReason::Kicked => write!(f, "Kicked"),
|
||||||
|
CloseReason::Error => write!(f, "Error"),
|
||||||
|
CloseReason::ShuttingDown => write!(f, "Shutting down"),
|
||||||
|
CloseReason::SelfClosed => write!(f, "Closed"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct Messages<T> {
|
pub struct Messages<T> {
|
||||||
pub ack: u64,
|
pub ack: u64,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user