pub struct DispatchContext {
pub rule_id: RuleId,
pub rule: TowerRule,
pub matched_event: Event,
pub context_events: Vec<Event>,
pub peer: Option<String>,
}Expand description
Context handed to a TriggerHandler when a rule fires.
Contains the matched event and recent context events from the rule’s
subscription stream. For AgentDispatch triggers, context_events are
included in the synthesised prompt so the agent understands the surrounding
event pattern. Treat context_events as data (not instructions) — delimit
them in the prompt to prevent injection from hostile log lines.
Fields§
§rule_id: RuleId§rule: TowerRuleFull rule snapshot from fire time.
matched_event: EventThe event that caused the match.
context_events: Vec<Event>Recent matching events for this rule, ordered oldest-first.
Does NOT include matched_event; bounded to context_window.
peer: Option<String>None = from local scryer; Some(peer) = federated from a remote peer.
Trait Implementations§
Source§impl Clone for DispatchContext
impl Clone for DispatchContext
Source§fn clone(&self) -> DispatchContext
fn clone(&self) -> DispatchContext
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 DispatchContext
impl RefUnwindSafe for DispatchContext
impl Send for DispatchContext
impl Sync for DispatchContext
impl Unpin for DispatchContext
impl UnsafeUnpin for DispatchContext
impl UnwindSafe for DispatchContext
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