Add the ability to downgrade trace agents to only hold weak references to the trace. The weak reference can be upgraded and dereferenced to the trace, but not upgraded to a full agent. This is because the caller already gave up the right to prevent compaction, and re-acquiring it, while technically possible, introduces uncertainty about what time can be selected.
Example
let weak_trace = arranged.trace.downgrade();
if let Some(trace) = weak_trace.upgrade() {
trace.as_deref().map_batches(|_| {});
}
Add the ability to downgrade trace agents to only hold weak references to the trace. The weak reference can be upgraded and dereferenced to the trace, but not upgraded to a full agent. This is because the caller already gave up the right to prevent compaction, and re-acquiring it, while technically possible, introduces uncertainty about what time can be selected.
Example