[][src]Struct tower::load::peak_ewma::PeakEwmaDiscover

pub struct PeakEwmaDiscover<D, C = CompleteOnResponse> { /* fields omitted */ }
This is supported on crate features load and discover only.

Wraps a D-typed stream of discovered services with PeakEwma.

Implementations

impl<D, C> PeakEwmaDiscover<D, C>[src]

pub fn new<Request>(
    discover: D,
    default_rtt: Duration,
    decay: Duration,
    completion: C
) -> Self where
    D: Discover,
    D::Service: Service<Request>,
    C: TrackCompletion<Handle, <D::Service as Service<Request>>::Response>, 
[src]

Wraps a D-typed Discover so that services have a PeakEwma load metric.

The provided default_rtt is used as the default RTT estimate for newly added services.

They decay value determines over what time period a RTT estimate should decay.

Trait Implementations

impl<D: Debug, C: Debug> Debug for PeakEwmaDiscover<D, C>[src]

impl<D, C> Stream for PeakEwmaDiscover<D, C> where
    D: Discover,
    C: Clone
[src]

type Item = Result<Change<D::Key, PeakEwma<D::Service, C>>, D::Error>

Values yielded by the stream.

impl<'pin, D, C> Unpin for PeakEwmaDiscover<D, C> where
    __PeakEwmaDiscover<'pin, D, C>: Unpin
[src]

Auto Trait Implementations

impl<D, C> RefUnwindSafe for PeakEwmaDiscover<D, C> where
    C: RefUnwindSafe,
    D: RefUnwindSafe
[src]

impl<D, C> Send for PeakEwmaDiscover<D, C> where
    C: Send,
    D: Send
[src]

impl<D, C> Sync for PeakEwmaDiscover<D, C> where
    C: Sync,
    D: Sync
[src]

impl<D, C> UnwindSafe for PeakEwmaDiscover<D, C> where
    C: UnwindSafe,
    D: 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<K, S, E, D> Discover for D where
    D: TryStream<Ok = Change<K, S>, Error = E> + ?Sized,
    K: Eq
[src]

type Key = K

This is supported on crate feature discover only.

A unique identifier for each active service. Read more

type Service = S

This is supported on crate feature discover only.

The type of Service yielded by this Discover. Read more

type Error = E

This is supported on crate feature discover only.

Error produced during discovery

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> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<St> StreamExt for St where
    St: Stream + ?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<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future

impl<S> TryStreamExt for S where
    S: TryStream + ?Sized
[src]

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