pub fn plan_transfer(
snapshot: &PathSnapshot,
link: LinkBehaviour,
advice: HeldAdvice,
bounds: LaneWindows,
) -> TransferPlanExpand description
Plan transfers on snapshot, given what the link has shown (link), the server’s advice,
and the client’s compiled window bounds. Pure: the same inputs always plan the same.
The rules, in precedence order:
- An unreachable path admits nothing (
Hold::Offline); a critical thermal state admits nothing (Hold::ThermalCritical). - The class is the cost’s, promoted to
adversewhile the link behaves adversely. - Bulk tiers wait on anything but an unmetered, well-behaved link (
Hold::Cost,Hold::Adverse), then on low-power mode, a serious thermal state, and a background deadline underMIN_BULK_DEADLINE, in that order. The index tier still runs. - The windows are
bounds, lowered by fresh advice, and narrowed to one session in low-power mode or from a serious thermal state up. - Under
adversea chunk targetsADVERSE_TARGET_REQUEST_DURATIONand a fetch uses the bounded range window; otherwiseTARGET_REQUEST_DURATIONand the open remainder.