aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mumd/src/state.rs')
-rw-r--r--mumd/src/state.rs13
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>,