Skip to main content

lumen_engine/node/
ids.rs

1use std::fmt;
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
4pub struct NodeId(pub u64);
5
6impl NodeId {
7    pub const fn new(value: u64) -> Self {
8        Self(value)
9    }
10}
11
12impl fmt::Display for NodeId {
13    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
14        write!(f, "{}", self.0)
15    }
16}
17
18#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct TrackId(pub u64);
20
21impl TrackId {
22    pub const fn new(value: u64) -> Self {
23        Self(value)
24    }
25}
26
27impl fmt::Display for TrackId {
28    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
29        write!(f, "{}", self.0)
30    }
31}