Struct Constant
struct Constant<T, M> { ... }
Wraps a type so that it implements Load and returns a constant load metric.
This load estimator is primarily useful for testing.
Implementations
impl<T, M: Copy> Constant<T, M>
const fn new(inner: T, load: M) -> SelfWraps a
T-typed service with a constantM-typed load metric.
impl<'__pin, T, M> Unpin for Constant<T, M>
impl<D: Discover + Unpin, M: Copy> Stream for Constant<D, M>
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<<Self as >::Item>>Yields the next discovery change set.
impl<K, S, E, D> Discover for Constant<T, M>
fn poll_discover(self: Pin<&mut D>, cx: &mut Context<'_>) -> Poll<Option<Result<<D as TryStream>::Ok, <D as TryStream>::Error>>>
impl<M, S, Target, Request> MakeService for Constant<T, M>
fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <M as MakeService<Target, Request>>::MakeError>>fn make_service(self: &mut Self, target: Target) -> <M as MakeService<Target, Request>>::Future
impl<S> TryStreamExt for Constant<T, M>
impl<S, M, Request> Service for Constant<S, M>
fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<Result<(), <Self as >::Error>>fn call(self: &mut Self, req: Request) -> <Self as >::Future
impl<S, T, E> TryStream for Constant<T, M>
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 Constant<T, M>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Constant<T, M>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Constant<T, M>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Constant<T, M>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for Constant<T, M>
impl<T> StreamExt for Constant<T, M>
impl<T> WithSubscriber for Constant<T, M>
impl<T, M> Freeze for Constant<T, M>
impl<T, M> RefUnwindSafe for Constant<T, M>
impl<T, M> Send for Constant<T, M>
impl<T, M> Sync for Constant<T, M>
impl<T, M> UnsafeUnpin for Constant<T, M>
impl<T, M> UnwindSafe for Constant<T, M>
impl<T, M: Copy + PartialOrd> Load for Constant<T, M>
fn load(self: &Self) -> M
impl<T, Request> ServiceExt for Constant<T, M>
impl<T, U> Into for Constant<T, M>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Constant<T, M>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Constant<T, M>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T: $crate::fmt::Debug, M: $crate::fmt::Debug> Debug for Constant<T, M>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result