Struct PeakEwmaDiscover
pub struct PeakEwmaDiscover<D, C = CompleteOnResponse> { /* private fields */ }
Wraps a D-typed stream of discovered services with PeakEwma.
Implementations
impl<D, C> PeakEwmaDiscover<D, C>
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>,Wraps a
D-typedDiscoverso that services have aPeakEwmaload metric.The provided
default_rttis used as the default RTT estimate for newly added services.They
decayvalue determines over what time period a RTT estimate should decay.
Trait Implementations
impl<'__pin, D, C> Unpin for PeakEwmaDiscover<D, C>
where
PinnedFieldsOf<__Origin<'__pin, D, C>>: Unpin,
impl<D, C> Stream for PeakEwmaDiscover<D, C>
where
D: Discover,
C: Clone,
type Item = Result<Change<<D as Discover>::Key, PeakEwma<<D as Discover>::Service, C>>, <D as Discover>::Error>;fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>
impl<D: Debug, C: Debug> Debug for PeakEwmaDiscover<D, C>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<D, C> Freeze for PeakEwmaDiscover<D, C>
where
D: Freeze,
C: Freeze,
impl<D, C> RefUnwindSafe for PeakEwmaDiscover<D, C>
where
D: RefUnwindSafe,
C: RefUnwindSafe,
impl<D, C> Send for PeakEwmaDiscover<D, C>
where
D: Send,
C: Send,
impl<D, C> Sync for PeakEwmaDiscover<D, C>
where
D: Sync,
C: Sync,
impl<D, C> UnsafeUnpin for PeakEwmaDiscover<D, C>
where
D: UnsafeUnpin,
C: UnsafeUnpin,
impl<D, C> UnwindSafe for PeakEwmaDiscover<D, C>
where
D: UnwindSafe,
C: UnwindSafe,
Blanket Implementations
impl<K, S, E, D> Discover for PeakEwmaDiscover<D, C>
where
D: TryStream<Ok = Change<K, S>, Error = E> + ?Sized,
K: Eq,
type Key = K;type Service = S;type Error = E;fn poll_discover(self: Pin<&mut D>, cx: &mut Context<'_>) -> Poll<Option<Result<<D as TryStream>::Ok, <D as TryStream>::Error>>>
impl<S> TryStreamExt for PeakEwmaDiscover<D, C>
where
S: TryStream + ?Sized,
impl<S, T, E> TryStream for PeakEwmaDiscover<D, C>
where
S: Stream<Item = Result<T, E>> + ?Sized,
type Ok = T;type Error = E;fn try_poll_next(self: Pin<&mut S>, cx: &mut Context<'_>) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>
impl<T> Any for PeakEwmaDiscover<D, C>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for PeakEwmaDiscover<D, C>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for PeakEwmaDiscover<D, C>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for PeakEwmaDiscover<D, C>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for PeakEwmaDiscover<D, C>
impl<T> StreamExt for PeakEwmaDiscover<D, C>
where
T: Stream + ?Sized,
impl<T> WithSubscriber for PeakEwmaDiscover<D, C>
impl<T, U> Into<U> for PeakEwmaDiscover<D, C>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for PeakEwmaDiscover<D, C>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for PeakEwmaDiscover<D, C>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>