pub struct CloudEvent {
pub event_type: String,
pub source: Option<String>,
pub data: Value,
pub attributes: HashMap<String, Value>,
}Expand description
A simplified CloudEvent-like structure for event publishing and consumption
Fields§
§event_type: StringEvent type (e.g., “com.example.event.occurred”)
source: Option<String>Event source
data: ValueEvent data payload
attributes: HashMap<String, Value>Additional attributes
Implementations§
Source§impl CloudEvent
impl CloudEvent
pub fn new(event_type: &str, data: Value) -> Self
pub fn with_source(self, source: &str) -> Self
pub fn with_attribute(self, key: &str, value: Value) -> Self
Sourcepub fn to_json_value(&self) -> Value
pub fn to_json_value(&self) -> Value
Converts this CloudEvent to a JSON Value for expression evaluation
Trait Implementations§
Source§impl Clone for CloudEvent
impl Clone for CloudEvent
Source§fn clone(&self) -> CloudEvent
fn clone(&self) -> CloudEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CloudEvent
impl RefUnwindSafe for CloudEvent
impl Send for CloudEvent
impl Sync for CloudEvent
impl Unpin for CloudEvent
impl UnsafeUnpin for CloudEvent
impl UnwindSafe for CloudEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more