mirror of
https://github.com/Start9Labs/rpc-toolkit.git
synced 2026-03-26 02:11:56 +00:00
debug
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use std::any::TypeId;
|
||||
use std::collections::VecDeque;
|
||||
use std::fmt::Debug;
|
||||
use std::marker::PhantomData;
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
@@ -147,6 +148,11 @@ impl<Context, Inherited> Clone for DynHandler<Context, Inherited> {
|
||||
Self(self.0.clone())
|
||||
}
|
||||
}
|
||||
impl<Context, Inherited> Debug for DynHandler<Context, Inherited> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("DynHandler").finish()
|
||||
}
|
||||
}
|
||||
#[async_trait::async_trait]
|
||||
impl<Context: crate::Context, Inherited: Send> HandleAny<Context>
|
||||
for DynHandler<Context, Inherited>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use std::collections::VecDeque;
|
||||
use std::fmt::Debug;
|
||||
|
||||
use clap::{ArgMatches, Command, CommandFactory, FromArgMatches};
|
||||
use imbl_value::imbl::OrdMap;
|
||||
@@ -28,6 +29,11 @@ impl<Context, Inherited> Clone for SubcommandMap<Context, Inherited> {
|
||||
Self(self.0.clone())
|
||||
}
|
||||
}
|
||||
impl<Context, Inherited> Debug for SubcommandMap<Context, Inherited> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_map().entries(self.0.iter()).finish()
|
||||
}
|
||||
}
|
||||
impl<Context, Inherited> SubcommandMap<Context, Inherited> {
|
||||
fn insert(&mut self, name: Option<&'static str>, handler: DynHandler<Context, Inherited>) {
|
||||
self.0.insert(Name(name), handler);
|
||||
@@ -73,7 +79,7 @@ impl<Context, Params, InheritedParams> std::fmt::Debug
|
||||
{
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_tuple("ParentHandler")
|
||||
// .field(&self.subcommands)
|
||||
.field(&self.subcommands)
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user