pub trait Codec { type Carrier; type Payload; type Output; type Error; fn encode( &self, carrier: impl Into, payload: impl Into, ) -> Result; fn decode(&self, encoded: impl Into) -> Result<(Self::Carrier, Self::Payload), Self::Error>; }