shapes_converter/shex_to_html/
node_id.rs

1use std::fmt::Display;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, PartialEq, Eq, Default, Clone, Copy, Hash, Serialize, Deserialize)]
6pub struct NodeId {
7    n: usize,
8}
9
10impl NodeId {
11    pub fn new(n: usize) -> NodeId {
12        NodeId { n }
13    }
14}
15
16impl Display for NodeId {
17    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
18        write!(f, "{}", self.n)?;
19        Ok(())
20    }
21}