pub mod balance; use futures_core::TryStream; use std::future::Future; pub trait Sealed {} /// Alias for a type-erased error type. pub type BoxError = Box; mod load { pub trait Load { type Metric; fn load(&self) -> Self::Metric; } } pub trait Discover { type Key; type Service; type Error; } impl Sealed> for D where D: TryStream, Error = E>, K: Eq, { } impl Discover for D where D: TryStream, Error = E>, K: Eq, { type Key = K; type Service = S; type Error = E; } pub struct Change(K, V); pub trait Service { type Response; type Error; type Future; } pub trait MakeService { type Response; type Error; type Service: Service; type MakeError; type Future; } impl Sealed<(Target, Request)> for M where M: Service, S: Service, { } impl MakeService for M where M: Service, S: Service, { type Response = S::Response; type Error = S::Error; type Service = S; type MakeError = M::Error; type Future = M::Future; }