pub struct WeightedPool {
pub pool: BackendPool,
pub weight: u32,
}Expand description
A dynamically-discovered group of backends (a BackendPool) together
with a relative traffic weight for the group as a whole. Which specific
pool member answers a given request is a plain round-robin over
pool.backends() at the time of selection — the weight only controls how
often this group is picked relative to other groups/backends, not which
member within it.
A weight of 0 causes the group to be skipped entirely. Always treated as
a plain HTTP/1.1 backend — BackendPool addresses are bare "host:port"
strings with no scheme to carry TLS intent.
Fields§
§pool: BackendPool§weight: u32Implementations§
Source§impl WeightedPool
impl WeightedPool
Sourcepub fn new(pool: BackendPool, weight: u32) -> Self
pub fn new(pool: BackendPool, weight: u32) -> Self
Create a new weighted pool.
Trait Implementations§
Source§impl Clone for WeightedPool
impl Clone for WeightedPool
Source§fn clone(&self) -> WeightedPool
fn clone(&self) -> WeightedPool
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WeightedPool
impl RefUnwindSafe for WeightedPool
impl Send for WeightedPool
impl Sync for WeightedPool
impl Unpin for WeightedPool
impl UnsafeUnpin for WeightedPool
impl UnwindSafe for WeightedPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more