fn maybe_guard_stream(
stream: SendableRecordBatchStream,
permit: Option<OwnedSemaphorePermit>,
) -> SendableRecordBatchStreamExpand description
Wraps stream so it holds permit until fully consumed. Returns stream
unchanged when no permit was acquired (limiter disabled).