diff options
| author | Eskil Queseth <eskilq@kth.se> | 2021-06-13 20:48:54 +0200 |
|---|---|---|
| committer | Eskil Queseth <eskilq@kth.se> | 2021-06-13 20:48:54 +0200 |
| commit | 465f21da46a7194e25894043ca2cca9ba958e11c (patch) | |
| tree | 0a1dd5381263e8e8d6d09f1c0940aeb11f497e49 /mumd/src/state.rs | |
| parent | 9bc2bdc5dca1399fa75d20a18f1a2dfb8ab4e325 (diff) | |
| download | mum-465f21da46a7194e25894043ca2cca9ba958e11c.tar.gz | |
add unreachable_pub lint and fix debug impl
Diffstat (limited to 'mumd/src/state.rs')
| -rw-r--r-- | mumd/src/state.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mumd/src/state.rs b/mumd/src/state.rs index 38d54d3..82810de 100644 --- a/mumd/src/state.rs +++ b/mumd/src/state.rs @@ -20,6 +20,7 @@ use mumlib::command::{ChannelTarget, Command, CommandResponse, MessageTarget, Mu use mumlib::config::Config; use mumlib::Error; use std::{ + fmt::Debug, iter, net::{SocketAddr, ToSocketAddrs}, sync::{Arc, RwLock}, @@ -63,6 +64,17 @@ pub enum ExecutionContext { ), } +impl Debug for ExecutionContext { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_tuple(match self { + ExecutionContext::TcpEventCallback(_) => "TcpEventCallback", + ExecutionContext::TcpEventSubscriber(_, _) => "TcpEventSubscriber", + ExecutionContext::Now(_) => "Now", + ExecutionContext::Ping(_, _) => "Ping", + }).finish() + } +} + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum StatePhase { Disconnected, @@ -70,6 +82,7 @@ pub enum StatePhase { Connected(VoiceStreamType), } +#[derive(Debug)] pub struct State { config: Config, server: Option<Server>, |
