sdk-rust
sdk-rust copied to clipboard
Event does not have `new` method
Users expect to use Event::new() to construct a event.
According to API guideline: https://rust-lang.github.io/api-guidelines/predictability.html
- we should implement
Event::new() - we should revise the doc to encourage the use of Event::new()`
I believe this is intentional. Instead, the builder pattern is used to force compliance with the different CloudEvent Spec versions (0.3 and 1.0). It aligns with this note in the API guidelines:
If your type has a multiplicity of construction options though, consider the builder pattern (C-BUILDER) instead.