/rust/registry/src/index.crates.io-1949cf8c6b5b557f/tower-0.5.3/src/macros.rs
Line | Count | Source |
1 | | #[cfg(any( |
2 | | feature = "util", |
3 | | feature = "spawn-ready", |
4 | | feature = "filter", |
5 | | feature = "make" |
6 | | ))] |
7 | | macro_rules! opaque_future { |
8 | | ($(#[$m:meta])* pub type $name:ident<$($param:ident),+> = $actual:ty;) => { |
9 | | pin_project_lite::pin_project! { |
10 | | $(#[$m])* |
11 | | pub struct $name<$($param),+> { |
12 | | #[pin] |
13 | | inner: $actual |
14 | | } |
15 | | } |
16 | | |
17 | | impl<$($param),+> $name<$($param),+> { |
18 | 0 | pub(crate) fn new(inner: $actual) -> Self { |
19 | 0 | Self { |
20 | 0 | inner |
21 | 0 | } |
22 | 0 | } Unexecuted instantiation: <tower::spawn_ready::future::ResponseFuture<_, _>>::new Unexecuted instantiation: <tower::filter::future::ResponseFuture<_, _>>::new Unexecuted instantiation: <tower::make::make_service::shared::SharedFuture<_>>::new Unexecuted instantiation: <tower::util::map_result::MapResultFuture<_, _>>::new Unexecuted instantiation: <tower::util::map_response::MapResponseFuture<_, _>>::new Unexecuted instantiation: <tower::util::then::ThenFuture<_, _, _>>::new Unexecuted instantiation: <tower::util::map_err::MapErrFuture<_, _>>::new |
23 | | } |
24 | | |
25 | | impl<$($param),+> std::fmt::Debug for $name<$($param),+> { |
26 | 0 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
27 | 0 | f.debug_tuple(stringify!($name)).field(&format_args!("...")).finish() |
28 | 0 | } Unexecuted instantiation: <tower::spawn_ready::future::ResponseFuture<_, _> as core::fmt::Debug>::fmt Unexecuted instantiation: <tower::util::map_result::MapResultFuture<_, _> as core::fmt::Debug>::fmt Unexecuted instantiation: <tower::util::map_response::MapResponseFuture<_, _> as core::fmt::Debug>::fmt Unexecuted instantiation: <tower::util::then::ThenFuture<_, _, _> as core::fmt::Debug>::fmt Unexecuted instantiation: <tower::util::map_err::MapErrFuture<_, _> as core::fmt::Debug>::fmt Unexecuted instantiation: <tower::filter::future::ResponseFuture<_, _> as core::fmt::Debug>::fmt Unexecuted instantiation: <tower::make::make_service::shared::SharedFuture<_> as core::fmt::Debug>::fmt |
29 | | } |
30 | | |
31 | | impl<$($param),+> std::future::Future for $name<$($param),+> |
32 | | where |
33 | | $actual: std::future::Future, |
34 | | { |
35 | | type Output = <$actual as std::future::Future>::Output; |
36 | | #[inline] |
37 | 0 | fn poll(self: std::pin::Pin<&mut Self>, cx: &mut std::task::Context<'_>) -> std::task::Poll<Self::Output> { |
38 | 0 | self.project().inner.poll(cx) |
39 | 0 | } Unexecuted instantiation: <tower::spawn_ready::future::ResponseFuture<_, _> as core::future::future::Future>::poll Unexecuted instantiation: <tower::util::map_result::MapResultFuture<_, _> as core::future::future::Future>::poll Unexecuted instantiation: <tower::util::map_response::MapResponseFuture<_, _> as core::future::future::Future>::poll Unexecuted instantiation: <tower::util::then::ThenFuture<_, _, _> as core::future::future::Future>::poll Unexecuted instantiation: <tower::util::map_err::MapErrFuture<_, _> as core::future::future::Future>::poll Unexecuted instantiation: <tower::filter::future::ResponseFuture<_, _> as core::future::future::Future>::poll Unexecuted instantiation: <tower::make::make_service::shared::SharedFuture<_> as core::future::future::Future>::poll |
40 | | } |
41 | | } |
42 | | } |