fn spawn_fetch_segment(
io: Arc<dyn WalObjectIo>,
object_seq: u64,
entry: FooterEntry,
permit: Option<OwnedSemaphorePermit>,
) -> impl Future<Output = (Result<Vec<Record>>, Option<OwnedSemaphorePermit>)> + Send + 'staticExpand description
Runs fetch_segment on a task of its own, so the fetch proceeds while
the read is busy with earlier segments, and returns the outcome with
permit. The task holds the permit, so the reserved bytes are released
only with the buffers of the fetch. Dropping the returned future, as a
dropped read does, aborts the task; a task that panics fails the fetch with
Error::WalSegmentFetch.