pub struct TracedSession<'e> { /* private fields */ }trace only.Expand description
Trace-enabled view over a crate::Engine engine. Constructed via
crate::Engine::trace. Mirrors crate::Session 1:1 — every
eval* returns a TracedRun<R> carrying the trace alongside the
result, where R is the same shape that Session::eval* would
return. Owns its own bumpalo::Bump across calls; reset is
per-call (the trace path always allocates a fresh arena to keep the
borrowed-result lifetime tied to the run).
Implementations§
Source§impl<'e> TracedSession<'e>
impl<'e> TracedSession<'e>
Sourcepub fn eval<D>(&self, compiled: &Logic, data: D) -> TracedRun<OwnedDataValue>where
D: OwnedInput,
pub fn eval<D>(&self, compiled: &Logic, data: D) -> TracedRun<OwnedDataValue>where
D: OwnedInput,
Traced evaluation of a pre-compiled crate::Logic returning
datavalue::OwnedDataValue. The trace surfaces only the
operators that survived compilation — constant sub-expressions
folded by crate::Engine::compile won’t appear as steps. For
full coverage on a one-shot run, prefer Self::eval_str.
Sourcepub fn eval_str<R, D>(&self, rule: R, data: D) -> TracedRun<String>where
R: IntoLogic,
D: OwnedInput,
pub fn eval_str<R, D>(&self, rule: R, data: D) -> TracedRun<String>where
R: IntoLogic,
D: OwnedInput,
One-shot traced evaluation with JSON-string boundary on both sides. Compiles internally with the optimizer + constant-fold passes disabled, so the trace surfaces every operator in the rule.
Sourcepub fn eval_into<T, R, D>(&self, rule: R, data: D) -> TracedRun<T>
Available on crate feature serde_json only.
pub fn eval_into<T, R, D>(&self, rule: R, data: D) -> TracedRun<T>
serde_json only.Typed traced evaluation: deserialise the result into
T: DeserializeOwned. Routes through serde_json.
Sourcepub fn eval_borrowed<'a, D>(
&self,
compiled: &'a Logic,
data: D,
arena: &'a Bump,
) -> TracedRun<&'a DataValue<'a>>where
D: EvalInput<'a>,
pub fn eval_borrowed<'a, D>(
&self,
compiled: &'a Logic,
data: D,
arena: &'a Bump,
) -> TracedRun<&'a DataValue<'a>>where
D: EvalInput<'a>,
Traced borrowed evaluation against a caller-owned arena. Mirrors
crate::Session::eval_borrowed / crate::Engine::evaluate
— the result references arena, while the trace data is owned
and outlives the arena.