futuresdr_types/
flowgraph_id.rs

1use serde::Deserialize;
2use serde::Serialize;
3use std::fmt;
4
5/// Port Identifier
6#[derive(Debug, Copy, Clone, PartialEq, Eq, Serialize, Deserialize)]
7pub struct FlowgraphId(pub usize);
8
9impl From<usize> for FlowgraphId {
10    fn from(item: usize) -> Self {
11        FlowgraphId(item)
12    }
13}
14
15impl fmt::Display for FlowgraphId {
16    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
17        write!(f, "FlowgraphId({})", self.0)
18    }
19}