-
Notifications
You must be signed in to change notification settings - Fork 62
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
Proposal to allow destructuring of Event #243
Comments
I'm sure I'm missing something, but what's the |
I needed a zero-sized type for the private field. I'm used to |
I guess I still don't understand. If you remove the |
Oh, I misunderstood your question, sorry. I added |
Ah, now I understand. For me, the value of preventing direct, field initialization of the struct isn't worth the "type noise" of |
I figured those fields were private very intentionally since there are builders to ensure the constructed Event is valid per the CloudEvent specification. Maybe @Lazzaretti can weigh in. |
I noticed this comment in the message tests:
https://github.com/cloudevents/sdk-rust/blob/main/src/event/message.rs#L185
So I made some changes to support destructuring an
Event
:https://github.com/ozabalaferrera/cloudevents-sdk-rust/compare/oz_upgrade_all...ozabalaferrera:cloudevents-sdk-rust:oz_add_destructuring?expand=1
@jcrossley3, do you think this is a worthwhile change? I ran into situations in the past where I wanted to destructure, but didn't think much of it until I saw the test comments. I believe this change shouldn't break anything.
The text was updated successfully, but these errors were encountered: