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_x
tox
, following C-GETTER - Now all setters returns the previous value of the field
- Now
Data
is 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_data
or the ownership withtake_data
. To set the data, you can use bothset_data
orset_data_unchecked
and you must manually invoke the conversion fromT
toevent::Data
(usually withtry_into()
) set_datacontenttype
andset_dataschema
now are part ofEvent
public API- Removed
Data::from_*
methods, since they were not really useful and they were confusing
Message APIs
- Now
message::Error
isSend
andSync
- Renamed some variants of
message::Error
, following G-GOOD-ERR
Integrations
- Actix-web integration: Renamed
RequestExt::into_event
toRequestExt::to_event
, following C-CONV - Actix-web integration: Renamed
cloudevents_sdk_actix_web::RequestExt
tocloudevents_sdk_actix_web::HttpRequestExt
for consistency - All integrations: All
*Ext
trait 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!