From 575fb508ee052c7c1d5c57eecce4a08f4fc31aec Mon Sep 17 00:00:00 2001 From: Nathan McCarty Date: Thu, 24 Nov 2022 03:03:16 -0500 Subject: [PATCH] feat!: Remove directional event BREAKING CHANGE: Remove directional event type --- src/types.rs | 52 ---------------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/src/types.rs b/src/types.rs index 0ba44d3..e272223 100644 --- a/src/types.rs +++ b/src/types.rs @@ -28,58 +28,6 @@ pub enum Either { Sad(B), } -/// Wrapper for a Directional [`Event`] -#[derive(Clone, PartialEq, Eq, Debug, PartialOrd, Ord, Hash)] -pub enum DirectionalEvent { - /// Incoming message, this node is the recipient - Inbound(I), - /// Outbound message, this node is the sender - Outbound(O), -} - -/// Wrapper for Directional [`Event`]'s flags -#[derive(PartialEq, Eq, Debug, PartialOrd, Ord, Hash)] -pub enum DirectionalEventFlags { - /// Incoming message, this node is the recipient - Inbound(I::Flags), - /// Outbound message, this node is the sender - Outbound(O::Flags), -} - -impl Clone for DirectionalEventFlags { - fn clone(&self) -> Self { - match self { - Self::Inbound(arg0) => Self::Inbound(arg0.clone()), - Self::Outbound(arg0) => Self::Outbound(arg0.clone()), - } - } -} - -impl Event for DirectionalEvent { - type Flags = DirectionalEventFlags; - - fn flags(&self) -> Self::Flags { - match self { - DirectionalEvent::Inbound(e) => DirectionalEventFlags::Inbound(e.flags()), - DirectionalEvent::Outbound(e) => DirectionalEventFlags::Outbound(e.flags()), - } - } - - fn stateless_clone(&self) -> Self { - match self { - DirectionalEvent::Inbound(e) => DirectionalEvent::Inbound(e.stateless_clone()), - DirectionalEvent::Outbound(e) => DirectionalEvent::Outbound(e.stateless_clone()), - } - } - - fn token(&mut self) -> Option { - match self { - DirectionalEvent::Inbound(e) => e.token(), - DirectionalEvent::Outbound(e) => e.token(), - } - } -} - /// Token for listening for responses to requests /// /// These tokens are always guaranteed, to have at most one equal counterpart, and they are -- 2.45.2