diff options
Diffstat (limited to 'src/event/connection.rs')
| -rw-r--r-- | src/event/connection.rs | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/src/event/connection.rs b/src/event/connection.rs index 99813fd..4af2164 100644 --- a/src/event/connection.rs +++ b/src/event/connection.rs @@ -1,13 +1,19 @@ -use std::net::SocketAddr; - use getset::Getters; -// TODO : identification -// TODO : reason type #[derive(Getters)] -pub struct ConnectionEvent { - #[getset(get = "pub")] - peer_addr: SocketAddr, - #[getset(get = "pub")] - local_addr: SocketAddr, +pub struct ConnectionEvent<Uid> +where + Uid: PartialEq, +{ + #[get = "pub"] + client_uid: Uid, +} + +impl<Uid> ConnectionEvent<Uid> +where + Uid: PartialEq, +{ + pub fn new(uid: Uid) -> Self { + Self { client_uid: uid } + } } |
