diff --git a/src/common.rs b/src/common.rs index 1ff11a20ccb6325adb7d29720b5c100ea6213c23..282dc579f0bd101f6a90f0ebe5173a768be39584 100644 --- a/src/common.rs +++ b/src/common.rs @@ -44,21 +44,20 @@ pub enum Polarity { #[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Copy, Clone, Debug)] pub struct Key(u64); -pub enum NewMainErr { +pub enum MainComponentErr { NoSuchComponent, NonPortTypeParameters, - WrongNumberOfArguments { expected: usize }, - WrongPortPolarity { index: usize }, } pub trait ProtocolDescription: Sized { type S: ComponentState; fn parse(pdl: &[u8]) -> Result; + fn component_polarities(&self, identifier: &[u8]) -> Result, MainComponentErr>; fn new_main_component( &self, identifier: &[u8], - ports: &[(Polarity, Key)], - ) -> Result; + ports: &[Key], + ) -> Result; } pub trait ComponentState: Sized + Clone {