diff --git a/src/hugr.rs b/src/hugr.rs index df99e8197..d741ae46d 100644 --- a/src/hugr.rs +++ b/src/hugr.rs @@ -179,7 +179,21 @@ pub struct Node { } /// A handle to a port for a node in the HUGR. -#[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Hash, Default, Debug, From)] +#[derive( + Clone, + Copy, + PartialEq, + PartialOrd, + Eq, + Ord, + Hash, + Default, + Debug, + From, + serde::Serialize, + serde::Deserialize, +)] +#[serde(transparent)] #[cfg_attr(feature = "pyo3", pyclass)] pub struct Port { offset: portgraph::PortOffset,