Skip to main content

drive

Function drive 

Source
pub fn drive<'a, M, F, R>(
    http: &'a Downloader,
    items: impl Stream<Item = Result<Transfer<M>, Error>> + Send + 'a,
    resolve: R,
    factory: F,
) -> impl Stream<Item = Outcome<M, F::Location>> + Send + 'a
where M: Clone + Send + 'static, F: SinkFactory + 'a, R: FnMut(&Transfer<M>) -> Result<Url, Error> + Send + 'a,
Expand description

One driver for every download path. Pulls items from the input stream, resolves each item’s source URL, asks the factory for a per-item sink, and runs run_download. Per-item errors (url resolution, sink build, transport failure) yield Failed and the loop continues to the next item — a one-element input stream therefore yields exactly one terminal outcome.