Struct MakeBalance
pub struct MakeBalance<S, Req> { /* private fields */ }
Constructs load balancers over dynamic service sets produced by a wrapped "inner" service.
This is effectively an implementation of MakeService except that it forwards the service
descriptors (Target) to an inner service (S), and expects that service to produce a
service set in the form of a Discover. It then wraps the service set in a Balance
before returning it as the "made" service.
See the module-level documentation for details on load balancing.
Implementations
impl<S, Req> MakeBalance<S, Req>
const fn new(make_discover: S) -> SelfBuild balancers using operating system entropy.
Trait Implementations
impl<S, Req> Clone for MakeBalance<S, Req>
where
S: Clone,
fn clone(&self) -> Self
impl<S, Req> Debug for MakeBalance<S, Req>
where
S: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<S, Target, Req> Service<Target> for MakeBalance<S, Req>
where
S: Service<Target>,
S::Response: Discover,
<S::Response as Discover>::Key: Hash,
<S::Response as Discover>::Service: Service<Req>,
<<S::Response as Discover>::Service as Service<Req>>::Error: Into<BoxError>,
type Response = Balance<<S as Service<Target>>::Response, Req>;type Error = <S as Service<Target>>::Error;type Future = MakeFuture<<S as Service<Target>>::Future, Req>;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>fn call(&mut self, target: Target) -> Self::Future