diff --git a/src/api/router/state.rs b/src/api/router/state.rs index 3362ef4f..e5609819 100644 --- a/src/api/router/state.rs +++ b/src/api/router/state.rs @@ -2,7 +2,7 @@ use std::{ops::Deref, sync::Arc}; use tuwunel_service::Services; -#[derive(Clone, Copy)] +#[derive(Clone, Copy, Debug)] pub struct State { services: *const Services, } diff --git a/src/core/utils/mutex_map.rs b/src/core/utils/mutex_map.rs index c60f890f..cc593014 100644 --- a/src/core/utils/mutex_map.rs +++ b/src/core/utils/mutex_map.rs @@ -9,10 +9,12 @@ use tokio::sync::OwnedMutexGuard as Omg; use crate::{Result, err}; /// Map of Mutexes +#[derive(Debug)] pub struct MutexMap { map: Map, } +#[derive(Debug)] pub struct Guard { map: Map, val: Omg, diff --git a/src/service/services.rs b/src/service/services.rs index 961bed21..cda9232c 100644 --- a/src/service/services.rs +++ b/src/service/services.rs @@ -1,4 +1,4 @@ -use std::sync::Arc; +use std::{fmt, sync::Arc}; use futures::{StreamExt, TryStreamExt}; use tokio::sync::Mutex; @@ -177,6 +177,12 @@ pub(crate) fn services(&self) -> impl Iterator> + Send { .into_iter() } +impl fmt::Debug for Services { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("Services").finish() + } +} + #[implement(Services)] pub async fn start(self: &Arc) -> Result> { debug_info!("Starting services...");