blob: 2183180b3935b18a23338916b1b7ab9f75c3206f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
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<Uid>
where
Uid: PartialEq,
{
#[get = "pub"]
connection_id: Uid,
#[get = "pub"]
reason: DisconnectReason,
}
|