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

Stop deriving Message trait implementation for all Serialize&Deserialize structs #1849

Open
SanjoDeundiak opened this issue Sep 9, 2021 · 1 comment

Comments

@SanjoDeundiak
Copy link
Member

We probably want to be derive Message trait only explicitly using

#[derive(Message)]

Without that, it's very easy to send things not intended to be Messages (happened few times)

@Szymongib
Copy link
Contributor

Hey @SanjoDeundiak, I could try to help with this.

After looking through the code, I think this could be approached in the following steps:

  • Introduce a new crate for proc macro, something like ockam_message_derive.
  • By default implement the trait for types like ockam_core::Any, String, Vec<8u> etc.
  • Go through the codebase deriving Message for existing custom message types.

Let me know what do you think about it.
Thanks!

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

Successfully merging a pull request may close this issue.

3 participants