diff --git a/rpc-toolkit/src/handler/adapters.rs b/rpc-toolkit/src/handler/adapters.rs index 6d711a1..0c8beab 100644 --- a/rpc-toolkit/src/handler/adapters.rs +++ b/rpc-toolkit/src/handler/adapters.rs @@ -30,7 +30,7 @@ pub trait HandlerExt: Handler + Sized { fn with_custom_display_fn( self, display: F, - ) -> CustomDisplayFn + ) -> CustomDisplayFn where F: Fn(HandleArgs, Self::Ok) -> Result<(), Self::Err>; fn with_inherited( @@ -66,7 +66,7 @@ impl HandlerExt for T { fn with_custom_display_fn( self, display: F, - ) -> CustomDisplayFn + ) -> CustomDisplayFn where F: Fn(HandleArgs, Self::Ok) -> Result<(), Self::Err>, { @@ -319,12 +319,12 @@ where } } -pub struct CustomDisplayFn { +pub struct CustomDisplayFn { _phantom: PhantomData, print: F, handler: H, } -impl Clone for CustomDisplayFn { +impl Clone for CustomDisplayFn { fn clone(&self) -> Self { Self { _phantom: PhantomData::new(), @@ -333,7 +333,7 @@ impl Clone for CustomDisplayFn { } } } -impl Debug for CustomDisplayFn { +impl Debug for CustomDisplayFn { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("CustomDisplayFn") .field("print", &self.print) @@ -341,7 +341,7 @@ impl Debug for CustomDisplayFn { .finish() } } -impl HandlerTypes for CustomDisplayFn +impl HandlerTypes for CustomDisplayFn where H: HandlerTypes, { @@ -351,7 +351,7 @@ where type Err = H::Err; } #[async_trait::async_trait] -impl Handler for CustomDisplayFn +impl Handler for CustomDisplayFn where Context: Send + Sync + 'static, H: Handler, @@ -414,7 +414,7 @@ where self.handler.method_from_dots(method, ctx_ty) } } -impl PrintCliResult for CustomDisplayFn +impl PrintCliResult for CustomDisplayFn where Context: IntoContext, H: HandlerTypes,