diff --git a/src/runtime2/communication.rs b/src/runtime2/communication.rs index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f3397eeba71f6fff803b9329a782911f1e2652ee 100644 --- a/src/runtime2/communication.rs +++ b/src/runtime2/communication.rs @@ -0,0 +1,38 @@ +use super::runtime::*; + +#[derive(Copy, Clone)] +pub struct PortId(pub u32); + +impl PortId { + pub fn new_invalid() -> Self { + return Self(u32::MAX); + } +} + +pub struct Peer { + pub id: CompId, + pub(crate) handle: CompHandle, +} + +pub enum PortKind { + Putter, + Getter, +} + +pub enum PortState { + Open, + Closed, +} + +pub struct Port { + pub self_id: PortId, + pub peer_id: PortId, + pub kind: PortKind, + pub state: PortState, + pub local_peer_index: u32, +} + +/// Public inbox: accessible by all threads. Essentially a MPSC channel +pub struct InboxPublic { + +} \ No newline at end of file