Skip to content

Commit

Permalink
Provide TraceAgent::trace_box_unstable to expose the inner trace
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
antiguru committed Aug 1, 2023
1 parent 99fa67d commit 6b806a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/operators/arrange/agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<RefCell<TraceBox<Tr>>> {
Rc::clone(&self.trace)
}
}

impl<Tr> TraceAgent<Tr>
Expand Down

0 comments on commit 6b806a8

Please sign in to comment.