Skip to main content

fold_to_edges

Function fold_to_edges 

Source
pub fn fold_to_edges<T>(ranked: Vec<T>) -> Vec<T>
Expand description

Deal an already-ranked (best-first) sequence to alternating ends: best at the top, second at the bottom, third just inside the top, and so on.

This is the Lost-in-the-Middle placement separated from the ranking. order_by_value pairs the two, ranking by raw score; a host with its own reranker, per-provider quotas, or a trust weighting should rank the frames itself and call this directly, because ranking across providers by raw score is a policy choice and not a protocol guarantee (SPEC.md ยง6.6, F10).