Derive or impl fmt::Debug on several structs.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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...");
|
||||
|
||||
Reference in New Issue
Block a user