diff --git a/src/message/serial.rs b/src/message/serial.rs index 5b4da0f..eeb5c6b 100644 --- a/src/message/serial.rs +++ b/src/message/serial.rs @@ -24,6 +24,25 @@ pub trait MessageReceiver impl MessageSender for (){} impl MessageReceiver for (){} +/// Identical to `()` in terms of the use of the MessageSender trait. +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct DefaultMessageSender; + +impl MessageSender for DefaultMessageSender{} + +/// Identical to `()` in terms of the use of the MessageReceiver trait. +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct DefaultMessageReceiver; + +impl MessageReceiver for DefaultMessageReceiver{} + +/// Identical to `()` in terms of the use of the MessageSender/Receiver traits. +#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct DefaultMessageSenderReceiver; + +impl MessageSender for DefaultMessageSenderReceiver{} +impl MessageReceiver for DefaultMessageSenderReceiver{} + #[derive(Debug)] pub(super) struct WriteCounter(pub usize, pub W);