This commit is contained in:
nora 2022-09-15 21:51:46 +02:00
parent 136f1b4bd9
commit 0f642ee243
2 changed files with 60 additions and 83 deletions

View file

@ -14,12 +14,6 @@ macro_rules! opaque_future {
}
}
impl<$($param),+> std::fmt::Debug for $name<$($param),+> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.debug_tuple(stringify!($name)).field(&format_args!("...")).finish()
}
}
impl<$($param),+> std::future::Future for $name<$($param),+>
where
$actual: std::future::Future,

View file

@ -1,25 +1,10 @@
//! Trait aliases for Services that produce specific types of Responses.
pub use self::make_service::shared::Shared;
pub use self::make_service::MakeService;
pub mod future {
//! Future types
pub use super::make_service::shared::SharedFuture;
}
mod make_service {
//! Contains [`MakeService`] which is a trait alias for a [`Service`] of [`Service`]s.
use crate::sealed::Sealed;
use std::task::{Context, Poll};
use crate::Service;
use std::task::{Context, Poll};
pub mod shared {
use std::convert::Infallible;
use std::task::{Context, Poll};
use crate::Service;
pub struct Shared<S> {
service: S,
@ -46,7 +31,6 @@ mod make_service {
/// Response future from [`Shared`] services.
pub type SharedFuture<S> = futures_util::future::Ready<Result<S, Infallible>>;
}
}
pub trait MakeService<Target, Request> {
type Response;
@ -84,4 +68,3 @@ mod make_service {
Service::call(self, target)
}
}
}