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

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

Construct load balancers (Balance) over dynamic service sets (Discover) produced by the "inner" service in response to requests coming from the "outer" service.

This construction may seem a little odd at first glance. This is not a layer that takes requests and produces responses in the traditional sense. Instead, it is more like MakeService in that it takes service descriptors (see Target on MakeService) and produces services. Since Balance spreads requests across a set of services, the inner service should produce a Discover, not just a single Service, given a service descriptor.

See the module-level documentation for details on load balancing.

Implementations

impl<D, Req> MakeBalanceLayer<D, Req>[src]

pub fn new() -> Self[src]

Build balancers using operating system entropy.

Trait Implementations

impl<D: Clone, Req: Clone> Clone for MakeBalanceLayer<D, Req>[src]

impl<D, Req> Debug for MakeBalanceLayer<D, Req>[src]

impl<D, Req> Default for MakeBalanceLayer<D, Req>[src]

impl<S, Req> Layer<S> for MakeBalanceLayer<S, Req>[src]

type Service = MakeBalance<S, Req>

The wrapped service

Auto Trait Implementations

impl<D, Req> RefUnwindSafe for MakeBalanceLayer<D, Req>[src]

impl<D, Req> Send for MakeBalanceLayer<D, Req>[src]

impl<D, Req> Sync for MakeBalanceLayer<D, Req>[src]

impl<D, Req> Unpin for MakeBalanceLayer<D, Req>[src]

impl<D, Req> UnwindSafe for MakeBalanceLayer<D, Req>[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> 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>,