Skip to content

Commit 5ad387a

Browse files
committed
1 parent 346858d commit 5ad387a

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

src/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ where
1717

1818
/// Attempted to issue a `call` when no more requests can be in flight.
1919
///
20-
/// See [`tower_service::Service::poll_ready`] and [`Client::with_limit`].
20+
/// See [`tower_service::Service::poll_ready`].
2121
TransportFull,
2222

2323
/// Attempted to issue a `call`, but the underlying transport has been closed.

src/lib.rs

+17
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,20 @@ mod sealed {
232232

233233
pub mod multiplex;
234234
pub mod pipeline;
235+
236+
/// impl Future.
237+
///
238+
/// https://github.com/rust-lang/rust/issues/65863
239+
#[cfg(doc)]
240+
pub struct DocFuture<O>(std::marker::PhantomData<O>);
241+
242+
#[cfg(doc)]
243+
impl<O> std::future::Future for DocFuture<O> {
244+
type Output = O;
245+
fn poll(
246+
self: std::pin::Pin<&mut Self>,
247+
_: &mut std::task::Context<'_>,
248+
) -> std::task::Poll<Self::Output> {
249+
unreachable!()
250+
}
251+
}

src/multiplex/client.rs

+8
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ where
9393
{
9494
type Error = SpawnError<NT::MakeError>;
9595
type Response = Client<NT::Transport, Error<NT::Transport, Request>, Request>;
96+
97+
#[cfg(not(doc))]
9698
type Future = impl Future<Output = Result<Self::Response, Self::Error>> + Send;
99+
#[cfg(doc)]
100+
type Future = crate::DocFuture<Result<Self::Response, Self::Error>>;
97101

98102
fn call(&mut self, target: Target) -> Self::Future {
99103
let maker = self.t_maker.make_transport(target);
@@ -390,7 +394,11 @@ where
390394
{
391395
type Response = T::Ok;
392396
type Error = E;
397+
398+
#[cfg(not(doc))]
393399
type Future = impl Future<Output = Result<Self::Response, Self::Error>> + Send;
400+
#[cfg(doc)]
401+
type Future = crate::DocFuture<Result<Self::Response, Self::Error>>;
394402

395403
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), E>> {
396404
Poll::Ready(ready!(self.mediator.poll_ready(cx)).map_err(|_| E::from(Error::ClientDropped)))

src/multiplex/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub mod server;
2626
pub use self::server::Server;
2727

2828
/// A convenience wrapper that lets you take separate transport and tag store types and use them as
29-
/// a single [`client::Transport`].
29+
/// a single transport.
3030
#[pin_project]
3131
#[derive(Debug)]
3232
pub struct MultiplexTransport<T, S> {

src/pipeline/client.rs

+8
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ where
7272
{
7373
type Error = SpawnError<NT::MakeError>;
7474
type Response = Client<NT::Transport, Error<NT::Transport, Request>, Request>;
75+
76+
#[cfg(not(doc))]
7577
type Future = impl Future<Output = Result<Self::Response, Self::Error>> + Send;
78+
#[cfg(doc)]
79+
type Future = crate::DocFuture<Result<Self::Response, Self::Error>>;
7680

7781
fn call(&mut self, target: Target) -> Self::Future {
7882
let maker = self.t_maker.make_transport(target);
@@ -350,7 +354,11 @@ where
350354
{
351355
type Response = T::Ok;
352356
type Error = E;
357+
358+
#[cfg(not(doc))]
353359
type Future = impl Future<Output = Result<Self::Response, Self::Error>> + Send;
360+
#[cfg(doc)]
361+
type Future = crate::DocFuture<Result<Self::Response, Self::Error>>;
354362

355363
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), E>> {
356364
Poll::Ready(ready!(self.mediator.poll_ready(cx)).map_err(|_| E::from(Error::ClientDropped)))

0 commit comments

Comments
 (0)