pub struct EvaluationTrace {
pub rule_id: String,
pub rule_name: String,
pub rule_version: u32,
pub result: PredicateResult,
pub transition: String,
pub action_fired: bool,
pub agent_status: Option<String>,
}Expand description
A trace of what happened during an evaluation batch.
This provides observability into rule evaluation, showing which rules were evaluated, their results, and whether actions were fired.
§Example
// Create a test batch
let schema = Schema::new(vec![Field::new("price", DataType::Float64, true)]);
let batch = RecordBatch::try_new(
Arc::new(schema),
vec![Arc::new(Float64Array::from(vec![150.0, 50.0]))],
)?;
let traces = engine.process_batch(&batch).await?;
for trace in traces {
if trace.action_fired {
println!("Rule '{}' activated!", trace.rule_name);
}
}Fields§
§rule_id: StringUnique identifier for the rule
rule_name: StringHuman-readable rule name
rule_version: u32Rule version number
result: PredicateResultResult of predicate evaluation
transition: StringState transition: “None”, “Activated”, or “Deactivated”
action_fired: boolWhether the action/agent was fired
agent_status: Option<String>Optional status message from the agent
Trait Implementations§
Source§impl Clone for EvaluationTrace
impl Clone for EvaluationTrace
Source§fn clone(&self) -> EvaluationTrace
fn clone(&self) -> EvaluationTrace
Returns a duplicate of the value. Read more
1.0.0 · 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 EvaluationTrace
impl Debug for EvaluationTrace
Auto Trait Implementations§
impl Freeze for EvaluationTrace
impl RefUnwindSafe for EvaluationTrace
impl Send for EvaluationTrace
impl Sync for EvaluationTrace
impl Unpin for EvaluationTrace
impl UnwindSafe for EvaluationTrace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more