Derive or impl fmt::Debug on several structs.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-11-25 21:33:40 +00:00
parent 8bb0d02619
commit 442a5aafeb
3 changed files with 10 additions and 2 deletions

View File

@@ -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,
}

View File

@@ -9,10 +9,12 @@ use tokio::sync::OwnedMutexGuard as Omg;
use crate::{Result, err};
/// Map of Mutexes
#[derive(Debug)]
pub struct MutexMap<Key, Val> {
map: Map<Key, Val>,
}
#[derive(Debug)]
pub struct Guard<Key, Val> {
map: Map<Key, Val>,
val: Omg<Val>,

View File

@@ -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<Item = Arc<dyn Service>> + 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<Self>) -> Result<Arc<Self>> {
debug_info!("Starting services...");