pub(crate) async fn download<R: Runtime>(
dirmgr: Weak<DirMgr<R>>,
state: &mut Box<dyn DirState>,
schedule: &mut TaskSchedule<R>,
attempt_id: AttemptId,
on_usable: &mut Option<Sender<()>>,
) -> Result<()>
Expand description
Download information into a DirState state machine until it is “complete”, or until we hit a non-recoverable error.
Use dirmgr
to load from the cache or to launch downloads.
Keep resetting the state as needed.
The first time that the state becomes “usable”, notify
the sender in on_usable
.