mirror of
https://github.com/Noratrieb/101844-repro.git
synced 2026-01-15 22:55:02 +01:00
remove bounds
This commit is contained in:
parent
ca3a6684cb
commit
28b397587e
2 changed files with 2 additions and 56 deletions
|
|
@ -1,32 +1,15 @@
|
|||
pub mod balance;
|
||||
|
||||
use futures_core::TryStream;
|
||||
use std::future::Future;
|
||||
pub trait Sealed<T> {}
|
||||
|
||||
/// Alias for a type-erased error type.
|
||||
pub type BoxError = Box<dyn std::error::Error + Send + Sync>;
|
||||
|
||||
mod load {
|
||||
pub trait Load {
|
||||
type Metric;
|
||||
fn load(&self) -> Self::Metric;
|
||||
}
|
||||
}
|
||||
|
||||
pub trait Discover {
|
||||
type Key;
|
||||
type Service;
|
||||
type Error;
|
||||
}
|
||||
|
||||
impl<K, S, E, D: ?Sized> Sealed<Change<(), ()>> for D
|
||||
where
|
||||
D: TryStream<Ok = Change<K, S>, Error = E>,
|
||||
K: Eq,
|
||||
{
|
||||
}
|
||||
|
||||
impl<K, S, E, D: ?Sized> Discover for D
|
||||
where
|
||||
D: TryStream<Ok = Change<K, S>, Error = E>,
|
||||
|
|
@ -49,25 +32,5 @@ pub trait MakeService<Target, Request> {
|
|||
type Response;
|
||||
type Error;
|
||||
type Service: Service<Request, Response = Self::Response, Error = Self::Error>;
|
||||
type MakeError;
|
||||
type Future;
|
||||
}
|
||||
|
||||
impl<M, S, Target, Request> Sealed<(Target, Request)> for M
|
||||
where
|
||||
M: Service<Target, Response = S>,
|
||||
S: Service<Request>,
|
||||
{
|
||||
}
|
||||
|
||||
impl<M, S, Target, Request> MakeService<Target, Request> for M
|
||||
where
|
||||
M: Service<Target, Response = S>,
|
||||
S: Service<Request>,
|
||||
{
|
||||
type Response = S::Response;
|
||||
type Error = S::Error;
|
||||
type Service = S;
|
||||
type MakeError = M::Error;
|
||||
type Future = M::Future;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue