[][src]Struct tower::balance::p2c::MakeBalance

pub struct MakeBalance<S, Req> { /* fields omitted */ }
This is supported on crate feature balance only.

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>[src]

pub fn new(make_discover: S) -> Self[src]

Build balancers using operating system entropy.

Trait Implementations

impl<S: Clone, Req: Clone> Clone for MakeBalance<S, Req>[src]

impl<S: Debug, Req: Debug> Debug for MakeBalance<S, Req>[src]

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>, 
[src]

type Response = Balance<S::Response, Req>

Responses given by the service.

type Error = S::Error

Errors produced by the service.

type Future = MakeFuture<S::Future, Req>

The future response value.

Auto Trait Implementations

impl<S, Req> RefUnwindSafe for MakeBalance<S, Req> where
    S: RefUnwindSafe
[src]

impl<S, Req> Send for MakeBalance<S, Req> where
    S: Send
[src]

impl<S, Req> Sync for MakeBalance<S, Req> where
    S: Sync
[src]

impl<S, Req> Unpin for MakeBalance<S, Req> where
    S: Unpin
[src]

impl<S, Req> UnwindSafe for MakeBalance<S, Req> where
    S: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Request> ServiceExt<Request> for T where
    T: Service<Request> + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,