[−][src]Crate cloudevents
This crate implements the CloudEvents Spec for Rust.
use cloudevents::{EventBuilder, AttributesReader}; use chrono::Utc; use url::Url; let event = EventBuilder::v10() .id("my_event.my_application") .source(Url::parse("http://localhost:8080").unwrap()) .time(Utc::now()) .build(); println!("CloudEvent Id: {}", event.get_id()); println!("CloudEvent Time: {}", event.get_time().unwrap());
If you're looking for Protocol Binding implementations, look at crates:
Modules
| event | Provides |
| message | Provides facilities to implement Protocol Bindings |
Structs
| Event | Data structure that represents a CloudEvent.
It provides methods to get the attributes through |
| EventBuilder | Builder to create |
Traits
| AttributesReader | Trait to get CloudEvents Context attributes. |
| AttributesWriter | Trait to set CloudEvents Context attributes. |