pub struct WeightedPool {
pub pool: BackendPool,
pub weight: u32,
}Available on non-WebAssembly only.
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§
Auto 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more