1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Traits for describing backend nodes and their observable properties.
use Debug;
use Hash;
/// A backend node that can be selected by a load balancing strategy.
/// Exposes a weight for weighted strategies. Higher weight = more traffic.
/// Exposes a load score for load-aware strategies. Lower is better.
/// Exposes remaining capacity for quota-aware strategies. Higher is better.
///
/// Complementary to [`LoadMetric`] (which exposes current load — lower is better):
/// - `LoadMetric`: "how busy is this node?" → lower wins
/// - `RateMetric`: "how much capacity remains?" → higher wins
///
/// A node can implement both — a node may have low load but little remaining
/// quota, or high load but ample quota.