Refreshed APIs and aligned with Rust conventions
Pre-release
Pre-release
On the behalf of CloudEvents community, I'm pleased to announce the 0.3 release of cloudevents/sdk-rust!
Changes to the APIs
This release includes important (breaking) changes, in order to align with the Rust API Guidelines. Below you'll find a non exhaustive list of all the relevant changes.
Event APIs
- The getters were renamed from
get_xtox, following C-GETTER - Now all setters returns the previous value of the field
- Now
Datais exported in the main crate - Implemented the various std traits
Debug,Display,Eq/PartialEq, whenever possible, in public data types - Reworked read/write data apis in
Event. Now there are no more hidden copies. To read data, you can get a borrow withget_dataor the ownership withtake_data. To set the data, you can use bothset_dataorset_data_uncheckedand you must manually invoke the conversion fromTtoevent::Data(usually withtry_into()) set_datacontenttypeandset_dataschemanow are part ofEventpublic API- Removed
Data::from_*methods, since they were not really useful and they were confusing
Message APIs
- Now
message::ErrorisSendandSync - Renamed some variants of
message::Error, following G-GOOD-ERR
Integrations
- Actix-web integration: Renamed
RequestExt::into_eventtoRequestExt::to_event, following C-CONV - Actix-web integration: Renamed
cloudevents_sdk_actix_web::RequestExttocloudevents_sdk_actix_web::HttpRequestExtfor consistency - All integrations: All
*Exttrait are now sealed, following C-SEALED
Other changes
- Actix-web updated to 3.0
- Now our CI runs the matrix of different supported build targets (glibc/musl/wasm) in each PR and run more lints
- Now our CI test examples
- A lot of additions to our docs
For a complete changelog, look at: https://github.com/cloudevents/sdk-rust/milestone/3?closed=1
What's next
In the next releases, we'll focus on improving the stability of the main crate cloudevents-sdk. We're also working on adding support for no_std and we hope to receive new contributions for new integrations!
Huge thanks to all people involved in this release!