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

Allow for more idiomatic Rust code #19

Open
thomaseizinger opened this issue Jan 21, 2021 · 1 comment
Open

Allow for more idiomatic Rust code #19

thomaseizinger opened this issue Jan 21, 2021 · 1 comment

Comments

@thomaseizinger
Copy link
Owner

Currently, the functions on the trait need to be named exactly the way the RPC function is called. That means we cannot use idiomatic Rust naming conventions like snake_case.

We should support this in a similar fashion as serde with its rename_all attribute.

Potentially, we also want to allow prefixes like they are present in Web3's JSON-RPC API: eth_, web3_, net_` etc without having to repeat them on every function.

@thomaseizinger
Copy link
Owner Author

Another usecase for renaming is to handle requests like this one: https://www.getmonero.org/resources/developer-guides/daemon-rpc.html#get_block

With renaming we could define two different trait functions with different interfaces that end up being the same RPC call.

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

No branches or pull requests

1 participant