From 16d1838e5bca2e90ca7cf8584a786b84fc409708 Mon Sep 17 00:00:00 2001 From: Silas Bartha Date: Mon, 27 May 2024 11:18:36 -0400 Subject: Initial Commit --- src/codec.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/codec.rs (limited to 'src/codec.rs') diff --git a/src/codec.rs b/src/codec.rs new file mode 100644 index 0000000..03cdf15 --- /dev/null +++ b/src/codec.rs @@ -0,0 +1,14 @@ +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>; +} -- cgit v1.2.3