mirror of
https://github.com/Start9Labs/rpc-toolkit.git
synced 2026-03-26 02:11:56 +00:00
remove requirement for type args on subcommand
This commit is contained in:
@@ -590,13 +590,12 @@ impl<Context, RemoteContext, H: Debug> Debug for RemoteCaller<Context, RemoteCon
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<Context, H, Inherited, LocalContext, RemoteContext> Handler<Inherited>
|
impl<Context, H, Inherited, RemoteContext> Handler<Inherited>
|
||||||
for WithContext<Context, RemoteCaller<LocalContext, RemoteContext, H>>
|
for WithContext<Context, RemoteCaller<Context, RemoteContext, H>>
|
||||||
where
|
where
|
||||||
Context: crate::Context,
|
Context: crate::Context + CallRemote<RemoteContext>,
|
||||||
LocalContext: crate::Context + CallRemote<RemoteContext>,
|
|
||||||
RemoteContext: crate::Context,
|
RemoteContext: crate::Context,
|
||||||
H: HandlerFor<RemoteContext> + CliBindings<LocalContext>,
|
H: HandlerFor<RemoteContext> + CliBindings<Context>,
|
||||||
H::Ok: Serialize + DeserializeOwned,
|
H::Ok: Serialize + DeserializeOwned,
|
||||||
H::Err: From<RpcError>,
|
H::Err: From<RpcError>,
|
||||||
H::Params: Serialize + DeserializeOwned,
|
H::Params: Serialize + DeserializeOwned,
|
||||||
@@ -608,8 +607,8 @@ where
|
|||||||
fn handler_for<C: crate::Context>(self) -> Option<DynHandler<C, Inherited>> {
|
fn handler_for<C: crate::Context>(self) -> Option<DynHandler<C, Inherited>> {
|
||||||
if TypeId::of::<C>() == TypeId::of::<RemoteContext>() {
|
if TypeId::of::<C>() == TypeId::of::<RemoteContext>() {
|
||||||
DynHandler::new(self.handler.handler.no_cli())
|
DynHandler::new(self.handler.handler.no_cli())
|
||||||
} else if TypeId::of::<C>() == TypeId::of::<LocalContext>() {
|
} else if TypeId::of::<C>() == TypeId::of::<Context>() {
|
||||||
DynHandler::new(CallRemoteHandler::<LocalContext, RemoteContext, _>::new(
|
DynHandler::new(CallRemoteHandler::<Context, RemoteContext, _>::new(
|
||||||
self.handler.handler,
|
self.handler.handler,
|
||||||
))
|
))
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ fn make_api<C: Context>() -> ParentHandler<C> {
|
|||||||
donde: String,
|
donde: String,
|
||||||
}
|
}
|
||||||
ParentHandler::<C>::new()
|
ParentHandler::<C>::new()
|
||||||
.subcommand::<C, _>(
|
.subcommand(
|
||||||
"echo",
|
"echo",
|
||||||
from_fn_async(
|
from_fn_async(
|
||||||
|c: ServerContext, EchoParams { next }: EchoParams| async move {
|
|c: ServerContext, EchoParams { next }: EchoParams| async move {
|
||||||
|
|||||||
Reference in New Issue
Block a user