Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[proc macros]: support for named parameters (JSON Map/Object) #445

Closed
Tracked by #492
niklasad1 opened this issue Aug 27, 2021 · 1 comment · Fixed by #526
Closed
Tracked by #492

[proc macros]: support for named parameters (JSON Map/Object) #445

niklasad1 opened this issue Aug 27, 2021 · 1 comment · Fixed by #526
Assignees

Comments

@niklasad1
Copy link
Member

niklasad1 commented Aug 27, 2021

Currently in proc macros one implementation for named parameter(s) exist here

The reason why it's not used is because it won't work to have a serde implementation inside a trait impl with generic type parameters, thus one would a get compile error such as can't use generic parameters from outer function.

The reason for this is how the RpcServer trait is generated.

pub trait RpcServer<T> {
   // defined methods without impls
   async fn foo() -> Result<(), Error>;


  ///Collects all the methods and subscriptions defined in the trait and adds them into a single `RpcModule`.
  fn into_rpc(self) -> jsonrpsee::RpcModule<Self> {
       // registering methods and decoding params goes here (which is problematic for serde impls)
  }
}
@dvdplm
Copy link
Contributor

dvdplm commented Oct 1, 2021

This could use a good description and a design suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants