diff --git a/src/runtime2/inbox2.rs b/src/runtime2/inbox2.rs index d07e95d6839724f9c0b4ae5066a4c42688dc893b..ff2d65a34b542ca74445a72bbbb3499091ce8011 100644 --- a/src/runtime2/inbox2.rs +++ b/src/runtime2/inbox2.rs @@ -3,7 +3,9 @@ use crate::runtime2::branch::BranchId; use crate::runtime2::ConnectorId; use crate::runtime2::port::PortIdLocal; -#[derive(Copy, Clone)] +// TODO: Remove Debug derive from all types + +#[derive(Debug, Copy, Clone)] pub(crate) struct PortAnnotation { pub port_id: PortIdLocal, pub registered_id: Option, @@ -11,32 +13,38 @@ pub(crate) struct PortAnnotation { } /// The header added by the synchronization algorithm to all. +#[derive(Debug, Clone)] pub(crate) struct SyncHeader { pub sending_component_id: ConnectorId, pub highest_component_id: ConnectorId, } /// The header added to data messages +#[derive(Debug, Clone)] pub(crate) struct DataHeader { pub expected_mapping: Vec, + pub sending_port: PortIdLocal, pub target_port: PortIdLocal, pub new_mapping: BranchId, } /// A data message is a message that is intended for the receiver's PDL code, /// but will also be handled by the consensus algrorithm +#[derive(Debug, Clone)] pub(crate) struct DataMessageFancy { pub sync_header: SyncHeader, pub data_header: DataHeader, pub content: ValueGroup, } +#[derive(Debug)] pub(crate) enum SyncContent { } /// A sync message is a message that is intended only for the consensus /// algorithm. +#[derive(Debug)] pub(crate) struct SyncMessageFancy { pub sync_header: SyncHeader, pub content: SyncContent, @@ -44,11 +52,14 @@ pub(crate) struct SyncMessageFancy { /// A control message is a message intended for the scheduler that is executing /// a component. +#[derive(Debug)] pub(crate) struct ControlMessageFancy { pub id: u32, // generic identifier, used to match request to response + pub sending_component_id: ConnectorId, pub content: ControlContent, } +#[derive(Debug)] pub(crate) enum ControlContent { PortPeerChanged(PortIdLocal, ConnectorId), CloseChannel(PortIdLocal), @@ -57,6 +68,7 @@ pub(crate) enum ControlContent { } /// Combination of data message and control messages. +#[derive(Debug)] pub(crate) enum MessageFancy { Data(DataMessageFancy), Sync(SyncMessageFancy),