From c8c161034950692e5d93c19718279027b138e7f9 Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Thu, 19 Oct 2023 10:31:38 -0400 Subject: [PATCH] added debug implementation --- performance/src/zeta.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/performance/src/zeta.rs b/performance/src/zeta.rs index e649136..91a9e36 100644 --- a/performance/src/zeta.rs +++ b/performance/src/zeta.rs @@ -1827,3 +1827,22 @@ impl Session { &self.s_remote } } + +impl std::fmt::Debug for Session where Crypto::SessionData: std::fmt::Debug { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("Session").field("session_data", &self.session_data).field("was_bob", &self.was_bob).field("state", &self.state.read().unwrap().beta).finish() + } +} +impl std::fmt::Debug for ZetaAutomata { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Null => write!(f, "Expired"), + Self::A1(..) => write!(f, "A1"), + Self::A3(..) => write!(f, "A3"), + Self::S1 => write!(f, "S1"), + Self::S2 => write!(f, "S2"), + Self::R1 { .. } => write!(f, "R1"), + Self::R2 { .. } => write!(f, "R2"), + } + } +}