pub struct EventTriggerRule {
pub on_event: EventKind,
pub source_workflow: String,
pub target_workflow: String,
pub max_chain_depth: u8,
pub conditions: Vec<TriggerCondition>,
}Expand description
A rule that maps a domain event to a workflow to trigger.
§Examples
use ironflow_runtime::trigger::event::EventTriggerRule;
use ironflow_store::entities::EventKind;
let rule = EventTriggerRule {
on_event: EventKind::RunFailed,
source_workflow: "deploy".to_string(),
target_workflow: "rollback".to_string(),
max_chain_depth: 3,
conditions: vec![],
};
assert_eq!(rule.target_workflow, "rollback");Fields§
§on_event: EventKindThe event kind to react to.
source_workflow: StringOnly react to events from this workflow.
target_workflow: StringThe workflow to trigger.
max_chain_depth: u8Maximum chaining depth (default 3). Beyond this, the event is ignored and logged.
conditions: Vec<TriggerCondition>Optional conditions that must all match for the rule to fire.
Evaluated with AND semantics. An empty list means the rule fires unconditionally (backward compatible).
Trait Implementations§
Source§impl Clone for EventTriggerRule
impl Clone for EventTriggerRule
Source§fn clone(&self) -> EventTriggerRule
fn clone(&self) -> EventTriggerRule
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 !RefUnwindSafe for EventTriggerRule
impl !UnwindSafe for EventTriggerRule
impl Freeze for EventTriggerRule
impl Send for EventTriggerRule
impl Sync for EventTriggerRule
impl Unpin for EventTriggerRule
impl UnsafeUnpin for EventTriggerRule
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