pub struct CloudEvent {
pub id: String,
pub source: String,
pub specversion: String,
pub type: String,
pub subject: String,
pub time: Option<String>,
pub dataschema: Option<String>,
pub datacontenttype: Option<String>,
pub data: Option<Value>,
}Expand description
Represents a single CloudEvent.
See CloudEvents schema: https://github.com/cloudevents/spec
Fields§
§id: StringIdentifies the event.
source: StringIdentifies the context in which an event happened.
specversion: StringThe version of the CloudEvents specification (defaults: “1.0”).
type: StringThe type of event (e.g., “prompt”).
subject: StringSubject of the event. Must be at least 1 character.
time: Option<String>Timestamp of when the occurrence happened. Must adhere to RFC 3339 or be omitted.
dataschema: Option<String>Identifies the schema that data adheres to.
datacontenttype: Option<String>Content type of the CloudEvents data value, typically “application/json”.
data: Option<Value>The event payload. Optional, if present must be a JSON object.
Trait Implementations§
Source§impl Debug for CloudEvent
impl Debug for CloudEvent
Source§impl<'de> Deserialize<'de> for CloudEvent
impl<'de> Deserialize<'de> for CloudEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CloudEvent
impl RefUnwindSafe for CloudEvent
impl Send for CloudEvent
impl Sync for CloudEvent
impl Unpin 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