From 6b806a8cc1bd528f1df4179babd119f753e97f47 Mon Sep 17 00:00:00 2001 From: Moritz Hoffmann Date: Tue, 1 Aug 2023 09:45:41 +0200 Subject: [PATCH] Provide TraceAgent::trace_box_unstable to expose the inner trace This method exposes the trace agent's trace, which requires the caller to maintain the invariants expected by Differential. Specifically, the caller should not mutate the structure, and should not hold on to strong references. The method is not part of Differential's (semi-) stable API. Signed-off-by: Moritz Hoffmann --- src/operators/arrange/agent.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/operators/arrange/agent.rs b/src/operators/arrange/agent.rs index 4a9e8f242..cc3b37bdc 100644 --- a/src/operators/arrange/agent.rs +++ b/src/operators/arrange/agent.rs @@ -160,6 +160,16 @@ where pub fn operator(&self) -> &OperatorInfo { &self.operator } + + /// Obtain a reference to the inner [`TraceBox`]. It is the caller's obligation to maintain + /// the trace box and this trace agent's invariants. Specifically, it is undefined behavior + /// to mutate the trace box. Keeping strong references can prevent resource reclamation. + /// + /// This method is subject to changes and removal and should not be considered part of a stable + /// interface. + pub fn trace_box_unstable(&self) -> Rc>> { + Rc::clone(&self.trace) + } } impl TraceAgent