pub struct ExternalEvent {
pub id: String,
pub event_type: String,
pub source: String,
pub subject: Option<String>,
pub timestamp: DateTime<Utc>,
pub data: Value,
pub metadata: HashMap<String, String>,
}Expand description
External event for emission.
Fields§
§id: StringEvent ID.
event_type: StringEvent type.
source: StringEvent source.
subject: Option<String>Event subject.
timestamp: DateTime<Utc>Event timestamp.
data: ValueEvent data.
metadata: HashMap<String, String>Event metadata.
Implementations§
Source§impl ExternalEvent
impl ExternalEvent
Sourcepub fn new(
event_type: impl Into<String>,
source: impl Into<String>,
data: Value,
) -> Self
pub fn new( event_type: impl Into<String>, source: impl Into<String>, data: Value, ) -> Self
Create a new external event.
Sourcepub fn with_subject(self, subject: impl Into<String>) -> Self
pub fn with_subject(self, subject: impl Into<String>) -> Self
Set event subject.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata.
Sourcepub fn from_workflow_state(
state: &WorkflowState,
event_type: impl Into<String>,
) -> Self
pub fn from_workflow_state( state: &WorkflowState, event_type: impl Into<String>, ) -> Self
Create from workflow state.
Trait Implementations§
Source§impl Clone for ExternalEvent
impl Clone for ExternalEvent
Source§fn clone(&self) -> ExternalEvent
fn clone(&self) -> ExternalEvent
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 moreSource§impl Debug for ExternalEvent
impl Debug for ExternalEvent
Source§impl<'de> Deserialize<'de> for ExternalEvent
impl<'de> Deserialize<'de> for ExternalEvent
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 ExternalEvent
impl RefUnwindSafe for ExternalEvent
impl Send for ExternalEvent
impl Sync for ExternalEvent
impl Unpin for ExternalEvent
impl UnsafeUnpin for ExternalEvent
impl UnwindSafe for ExternalEvent
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