mirror of
https://github.com/Start9Labs/rpc-toolkit.git
synced 2026-03-26 02:11:56 +00:00
fix custom_display_fn
This commit is contained in:
@@ -30,9 +30,9 @@ pub trait HandlerExt<Context: crate::Context>: HandlerFor<Context> + Sized {
|
|||||||
fn with_custom_display_fn<C: crate::Context, F>(
|
fn with_custom_display_fn<C: crate::Context, F>(
|
||||||
self,
|
self,
|
||||||
display: F,
|
display: F,
|
||||||
) -> CustomDisplayFn<F, Self, Context>
|
) -> CustomDisplayFn<F, Self, C>
|
||||||
where
|
where
|
||||||
F: Fn(HandlerArgsFor<Context, Self>, Self::Ok) -> Result<(), Self::Err>;
|
F: Fn(HandlerArgsFor<C, Self>, Self::Ok) -> Result<(), Self::Err>;
|
||||||
fn with_inherited<Params, InheritedParams, F>(
|
fn with_inherited<Params, InheritedParams, F>(
|
||||||
self,
|
self,
|
||||||
f: F,
|
f: F,
|
||||||
@@ -64,12 +64,9 @@ impl<Context: crate::Context, T: HandlerFor<Context> + Sized> HandlerExt<Context
|
|||||||
handler: self,
|
handler: self,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn with_custom_display_fn<C: crate::Context, F>(
|
fn with_custom_display_fn<C: crate::Context, F>(self, display: F) -> CustomDisplayFn<F, Self, C>
|
||||||
self,
|
|
||||||
display: F,
|
|
||||||
) -> CustomDisplayFn<F, Self, Context>
|
|
||||||
where
|
where
|
||||||
F: Fn(HandlerArgsFor<Context, Self>, Self::Ok) -> Result<(), Self::Err>,
|
F: Fn(HandlerArgsFor<C, Self>, Self::Ok) -> Result<(), Self::Err>,
|
||||||
{
|
{
|
||||||
CustomDisplayFn {
|
CustomDisplayFn {
|
||||||
_phantom: PhantomData::new(),
|
_phantom: PhantomData::new(),
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ fn make_api<C: Context>() -> ParentHandler<C> {
|
|||||||
))
|
))
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
.with_custom_display_fn(|_, a| Ok(println!("{a}")))
|
||||||
.with_call_remote::<CliContext>(),
|
.with_call_remote::<CliContext>(),
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
|
|||||||
Reference in New Issue
Block a user