remove shared

git
This commit is contained in:
nora 2022-09-15 22:15:05 +02:00
parent 93c5022ae4
commit c5f61214b6

View file

@ -1,9 +1,7 @@
// #![allow(warnings)]
pub mod balance;
use futures_core::TryStream;
use std::{convert::Infallible, future::Future};
use std::future::Future;
pub trait Sealed<T> {}
/// Alias for a type-erased error type.
@ -17,7 +15,7 @@ mod load {
}
pub trait Discover {
type Key: Eq;
type Key;
type Service;
type Error;
}
@ -52,37 +50,6 @@ pub trait Service<Request> {
type Future: Future<Output = Result<Self::Response, Self::Error>>;
}
pub struct Shared<S> {
service: S,
}
impl<S, T> Service<T> for Shared<S>
where
S: Clone,
{
type Response = S;
type Error = Infallible;
type Future = SharedFuture<S>;
}
pub struct SharedFuture<S> {
_s: S,
}
impl<S> std::future::Future for SharedFuture<S>
where
std::future::Ready<Result<S, Infallible>>: std::future::Future,
{
type Output = <std::future::Ready<Result<S, Infallible>> as std::future::Future>::Output;
fn poll(
self: std::pin::Pin<&mut Self>,
_: &mut std::task::Context<'_>,
) -> std::task::Poll<Self::Output> {
todo!()
}
}
pub trait MakeService<Target, Request> {
type Response;
type Error;