Struct tower_load::Constant [−][src]
Wraps a type so that Load::load
returns a constant value.
Implementations
impl<T, M: Copy> Constant<T, M>
[src][−]
pub fn new(inner: T, load: M) -> Self
[src][−]
Wraps a T
-typed service with a constant M
-typed load metric.
Trait Implementations
impl<T: Debug, M: Debug> Debug for Constant<T, M>
[src][+]
impl<D: Discover + Unpin, M: Copy> Discover for Constant<D, M>
[src][+]
type Key = D::Key
type Service = Constant<D::Service, M>
type Error = D::Error
fn poll_discover(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<Change<D::Key, Self::Service>, D::Error>>
[src][−]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Result<Change<D::Key, Self::Service>, D::Error>>
impl<T, M: Copy + PartialOrd> Load for Constant<T, M>
[src][+]
impl<T, M> PinnedDrop for Constant<T, M>
[src][+]
impl<S, M, Request> Service<Request> for Constant<S, M> where
S: Service<Request>,
M: Copy,
[src][+]
S: Service<Request>,
M: Copy,
impl<'pin, T, M> Unpin for Constant<T, M> where
__Constant<'pin, T, M>: Unpin,
[src]
__Constant<'pin, T, M>: Unpin,
impl<T, M> UnsafeUnpin for Constant<T, M>
[src]
Auto Trait Implementations
impl<T, M> RefUnwindSafe for Constant<T, M> where
M: RefUnwindSafe,
T: RefUnwindSafe,
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, M> Send for Constant<T, M> where
M: Send,
T: Send,
M: Send,
T: Send,
impl<T, M> Sync for Constant<T, M> where
M: Sync,
T: Sync,
M: Sync,
T: Sync,
impl<T, M> UnwindSafe for Constant<T, M> where
M: UnwindSafe,
T: UnwindSafe,
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,