[][src]Struct tower::balance::pool::Pool

pub struct Pool<MS, Target, Request> where
    MS: MakeService<Target, Request>,
    MS::MakeError: Into<BoxError>,
    MS::Error: Into<BoxError>,
    Target: Clone
{ /* fields omitted */ }
This is supported on crate feature balance only.

A dynamically sized, load-balanced pool of Service instances.

Implementations

impl<MS, Target, Request> Pool<MS, Target, Request> where
    MS: MakeService<Target, Request>,
    MS::Service: Load,
    <MS::Service as Load>::Metric: Debug,
    MS::MakeError: Into<BoxError>,
    MS::Error: Into<BoxError>,
    Target: Clone
[src]

pub fn new(make_service: MS, target: Target) -> Self[src]

Construct a new dynamically sized Pool.

If many calls to poll_ready return Pending, new_service is used to construct another Service that is then added to the load-balanced pool. If many calls to poll_ready succeed, the most recently added Service is dropped from the pool.

Trait Implementations

impl<MS, Target, Request> Debug for Pool<MS, Target, Request> where
    MS: MakeService<Target, Request> + Debug,
    MS::MakeError: Into<BoxError>,
    MS::Error: Into<BoxError>,
    Target: Clone + Debug,
    MS::Service: Debug,
    Request: Debug
[src]

impl<MS, Target, Req> Service<Req> for Pool<MS, Target, Req> where
    MS: MakeService<Target, Req>,
    MS::Service: Load,
    <MS::Service as Load>::Metric: Debug,
    MS::MakeError: Into<BoxError>,
    MS::Error: Into<BoxError>,
    Target: Clone
[src]

type Response = <Balance<Pin<Box<PoolDiscoverer<MS, Target, Req>>>, Req> as Service<Req>>::Response

Responses given by the service.

type Error = <Balance<Pin<Box<PoolDiscoverer<MS, Target, Req>>>, Req> as Service<Req>>::Error

Errors produced by the service.

type Future = <Balance<Pin<Box<PoolDiscoverer<MS, Target, Req>>>, Req> as Service<Req>>::Future

The future response value.

Auto Trait Implementations

impl<MS, Target, Request> !RefUnwindSafe for Pool<MS, Target, Request>[src]

impl<MS, Target, Request> Send for Pool<MS, Target, Request> where
    MS: Send,
    Request: Send,
    Target: Send,
    <MS as MakeService<Target, Request>>::Future: Send,
    <MS as MakeService<Target, Request>>::Service: Send
[src]

impl<MS, Target, Request> Sync for Pool<MS, Target, Request> where
    MS: Sync,
    Request: Sync,
    Target: Sync,
    <MS as MakeService<Target, Request>>::Future: Sync,
    <MS as MakeService<Target, Request>>::Service: Sync
[src]

impl<MS, Target, Request> Unpin for Pool<MS, Target, Request> where
    Request: Unpin
[src]

impl<MS, Target, Request> !UnwindSafe for Pool<MS, Target, Request>[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, 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>,