mirror of
https://github.com/Noratrieb/101844-repro.git
synced 2026-01-17 07:25:02 +01:00
smaller
This commit is contained in:
parent
136f1b4bd9
commit
0f642ee243
2 changed files with 60 additions and 83 deletions
|
|
@ -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),+>
|
impl<$($param),+> std::future::Future for $name<$($param),+>
|
||||||
where
|
where
|
||||||
$actual: std::future::Future,
|
$actual: std::future::Future,
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,10 @@
|
||||||
//! Trait aliases for Services that produce specific types of Responses.
|
//! 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 crate::sealed::Sealed;
|
||||||
use std::task::{Context, Poll};
|
|
||||||
use crate::Service;
|
use crate::Service;
|
||||||
|
use std::task::{Context, Poll};
|
||||||
|
|
||||||
pub mod shared {
|
|
||||||
use std::convert::Infallible;
|
use std::convert::Infallible;
|
||||||
use std::task::{Context, Poll};
|
|
||||||
use crate::Service;
|
|
||||||
|
|
||||||
pub struct Shared<S> {
|
pub struct Shared<S> {
|
||||||
service: S,
|
service: S,
|
||||||
|
|
@ -46,7 +31,6 @@ mod make_service {
|
||||||
/// Response future from [`Shared`] services.
|
/// Response future from [`Shared`] services.
|
||||||
pub type SharedFuture<S> = futures_util::future::Ready<Result<S, Infallible>>;
|
pub type SharedFuture<S> = futures_util::future::Ready<Result<S, Infallible>>;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
pub trait MakeService<Target, Request> {
|
pub trait MakeService<Target, Request> {
|
||||||
type Response;
|
type Response;
|
||||||
|
|
@ -84,4 +68,3 @@ mod make_service {
|
||||||
Service::call(self, target)
|
Service::call(self, target)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue