Skip to main content

TracedSession

Struct TracedSession 

Source
pub struct TracedSession<'e> { /* private fields */ }
Available on crate feature 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>

Source

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.

Source

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.

Source

pub fn eval_into<T, R, D>(&self, rule: R, data: D) -> TracedRun<T>

Available on crate feature serde_json only.

Typed traced evaluation: deserialise the result into T: DeserializeOwned. Routes through serde_json.

Source

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.

Auto Trait Implementations§

§

impl<'e> Freeze for TracedSession<'e>

§

impl<'e> !RefUnwindSafe for TracedSession<'e>

§

impl<'e> Send for TracedSession<'e>

§

impl<'e> Sync for TracedSession<'e>

§

impl<'e> Unpin for TracedSession<'e>

§

impl<'e> UnsafeUnpin for TracedSession<'e>

§

impl<'e> !UnwindSafe for TracedSession<'e>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.