pub fn allocate(
roots: &[(StorageRoot, RootCapacity)],
candidates: &[AllocationCandidate],
) -> (Vec<AllocationDecision>, Vec<AllocationCandidate>)Expand description
Allocate candidates to roots using deterministic first-fit packing.
Candidates are considered by increasing peer count, then path, then hash. Roots are considered in the order supplied. A candidate is allocated at most once, and each allocation reserves its size for subsequent candidates on that root. Disabled roots, roots below their minimum free threshold, and roots without sufficient remaining capacity are skipped.
Invalid candidate paths are returned as unallocated candidates.