mux: PrefetchedSectorSource event_fn + delete DiscStream::new_pipeline

* `PrefetchedSectorSource::new_with_events` adds an optional
  `event_fn` callback that fires `BytesRead` after every successful
  batch from the producer thread. The original `new()` becomes a
  thin no-events wrapper. Lets autorip wire the highway and still
  get UI progress events without polling the consumer side.

* `build_iso_pipeline` grows an `event_fn` arg so the autorip
  multipass mux can pipe BytesRead straight through to its progress
  UI.

* Stream trait gains a default `errors() -> u64` method (= 0) so
  Box<dyn Stream> callers (autorip's mux loop) can read the
  skip-on-error counter without downcasting. `DiscStream` overrides
  to return its `errors` field.

* Delete `DiscStream::new_pipeline` and the pipeline-mode fields
  (`demux_thread`, `demux_rx`) plus the `read_pipeline` helper.
  All pipeline construction now goes through
  `PipelinedPesStream` via `build_iso_pipeline`; `DiscStream`
  becomes the single-thread-only inline path used by the drive
  single-pass read.

* `lib.rs` re-exports `build_iso_pipeline`.
This commit is contained in:
2026-05-19 14:19:37 -07:00
parent 968eee0b14
commit 1dfcf899ad
5 changed files with 60 additions and 226 deletions
+10
View File
@@ -115,6 +115,16 @@ pub trait Stream: Send {
fn headers_ready(&self) -> bool {
true
}
/// Cumulative count of read errors the stream skipped past (e.g.
/// zero-filled bad sectors on a live drive). Default `0` for
/// streams that don't have a notion of skip-on-error (file ISO,
/// network, stdio, the pipeline highway, etc.); concrete impls
/// with adaptive retry (`DiscStream` on the drive single-pass
/// path) override.
fn errors(&self) -> u64 {
0
}
}
/// Wraps any output stream and counts bytes written.