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
26
use crate::types::Id;
use core::fmt::{Debug, Display, Formatter};
use serde::{Deserialize, Serialize};

/// CometD ClientId.
#[derive(Clone, Copy, Hash, Eq, PartialEq, Deserialize, Serialize)]
pub struct ClientId(Id);

impl ClientId {
    #[inline(always)]
    pub(crate) fn gen() -> Self {
        Self(Id::gen())
    }
}

impl Debug for ClientId {
    fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
        Debug::fmt(&self.0, f)
    }
}

impl Display for ClientId {
    fn fmt(&self, f: &mut Formatter<'_>) -> core::fmt::Result {
        Display::fmt(&self.0, f)
    }
}