Rust CDEvents SDK
Rust SDK to emit CDEvents.
The SDK can be used to create CDEvents and send them as CloudEvents, as well as parse a received CloudEvent into a CDEvent.
Create and send your first CDEvent as CloudEvent
Import the modules in your code
= "0.3"
To send a CDEvent as CloudEvent:
// from examples/pipelinerun_finished.rs
use Error;
use ;
use ;
See the CloudEvents docs as well.
Features
- support cdevents spec 0.5.0
- support cdevents spec 0.4.1
- support cdevents spec 0.3.0
- support of custom event
- compile-time generation of type for custom event
- runtime validation (download of jsonschemas & validation)
- serialize/deserialize of custom event (type
dev.cdeventsx.{subject}.{predicate}.{version}) - partial validation of custom event (
subject.contentis not validated, stored as json)
- Cloudevents support (provide wrapper/extractor for CDEvent)
- CDEvent stored into static types (=> no use of jsonshema at runtime)
- rutime validation for scalar types (purl, datetime, uri-reference)
- report clear and readable error messages on deserialization
- provide type with builder pattern (fluent)
- provide random/sample generator for CDEvent (property based testing)
- test
serialization(deserialization(of spec's examples & conformances)) == spec's examples & conformances - test
serialization(random CDEvent) matches the jsonschemas