Skip to content

Proposal to allow destructuring of Event #243

Open
@ozabalaferrera

Description

@ozabalaferrera

I noticed this comment in the message tests:
https://github.com/cloudevents/sdk-rust/blob/main/src/event/message.rs#L185

 #[test]
    fn message_v03_roundtrip_binary() -> Result<()> {
        //TODO this code smells because we're missing a proper way in the public APIs
        // to destructure an event and rebuild it

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions