diff --git a/src/runtime/mod.rs b/src/runtime/mod.rs index 7f9122e289fe4b875480eb968394b8ca5aa0e7a4..2cebca9b308e8d556f4b84a1385d90d50715f8a5 100644 --- a/src/runtime/mod.rs +++ b/src/runtime/mod.rs @@ -108,7 +108,7 @@ struct VecSet { // owns their destination port. `LocalComponent` corresponds with messages for components // managed by the connector itself (hinting for it to look it up in a local structure), // whereas the other variants direct the connector to forward the messages over the network. -#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)] enum Route { LocalComponent, NetEndpoint { index: usize }, @@ -137,25 +137,8 @@ enum SetupMsg { LeaderWave { wave_leader: ConnectorId }, LeaderAnnounce { tree_leader: ConnectorId }, YouAreMyParent, - SessionGather { unoptimized_map: HashMap }, - SessionScatter { optimized_map: HashMap }, } -// A data structure encoding the state of a connector, passed around -// during the session optimization procedure. -#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] -struct SessionInfo { - serde_proto_description: SerdeProtocolDescription, - port_info: PortInfoMap, - endpoint_incoming_to_getter: Vec, - proto_components: HashMap, -} - -// Newtype wrapper for an Arc, -// such that it can be (de)serialized for transmission over the network. -#[derive(Debug, Clone)] -struct SerdeProtocolDescription(Arc); - // Control message particular to the communication phase. // as such, it's annotated with a round_index #[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] @@ -296,7 +279,7 @@ struct EndpointStore { } // The information associated with a port identifier, designed for local storage. -#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[derive(Clone, Debug)] struct PortInfo { owner: ComponentId, peer: Option, @@ -314,7 +297,7 @@ struct MyPortInfo { // Newtype around port info map, allowing the implementation of some // useful methods -#[derive(Default, Debug, Clone, serde::Serialize, serde::Deserialize)] +#[derive(Default, Debug, Clone)] struct PortInfoMap { // invariant: self.invariant_preserved() // `owned` is redundant information, allowing for fast lookup @@ -378,7 +361,7 @@ struct Predicate { // from the solutions of its children. Those children are either locally-managed components, // (which are leaves in the solution tree), or other connectors reachable through the given // network endpoint (which are internal nodes in the solution tree). -#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)] enum SubtreeId { LocalComponent(ComponentId), NetEndpoint { index: usize }, @@ -868,24 +851,6 @@ impl Debug for Predicate { f.debug_set().entries(self.assigned.iter().map(Assignment)).finish() } } -impl serde::Serialize for SerdeProtocolDescription { - fn serialize(&self, serializer: S) -> Result - where - S: serde::Serializer, - { - let inner: &ProtocolDescription = &self.0; - inner.serialize(serializer) - } -} -impl<'de> serde::Deserialize<'de> for SerdeProtocolDescription { - fn deserialize(deserializer: D) -> Result - where - D: serde::Deserializer<'de>, - { - let inner: ProtocolDescription = ProtocolDescription::deserialize(deserializer)?; - Ok(Self(Arc::new(inner))) - } -} impl IdParts for SpecVar { fn id_parts(self) -> (ConnectorId, U32Suffix) { self.0.id_parts()