Skip to content

Commit

Permalink
workaround bug in rustdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocodutra committed Feb 5, 2019
1 parent e6baddc commit 7fa1cec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/dispatcher/async.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::dispatcher::Dispatcher;
use futures::channel::{mpsc, oneshot};
use futures::future::{FutureExt, TryFutureExt};
use futures::future::{TryFutureExt, UnwrapOrElse};
use futures::stream::StreamExt;
use futures::task::{SpawnError, SpawnExt};
use std::marker::PhantomData;
Expand Down Expand Up @@ -157,7 +157,11 @@ impl<D, A> Dispatcher<A> for AsyncHandle<D, A>
where
D: Dispatcher<A>,
{
existential type Output: FutureExt<Output = D::Output>;
/// A type that implements `FutureExt<Output = D::Output>`.
///
/// _**Important:** do not rely on the actual type,_
/// _this will become an existential type once issues with rustdoc are solved._
type Output = Promise<D::Output>;

/// Asynchronously sends an action through the dispatcher managed by [Async](struct.Async.html)
/// and returns a *promise* to its output.
Expand All @@ -175,6 +179,8 @@ where
}
}

type Promise<T> = UnwrapOrElse<oneshot::Receiver<T>, fn(oneshot::Canceled) -> T>;

#[cfg(test)]
mod tests {
use super::*;
Expand Down
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
//!
//! Enables integration with [futures-rs](https://crates.io/crates/futures-preview).
#![cfg_attr(
feature = "async",
feature(async_await, await_macro, futures_api, existential_type)
)]
#![cfg_attr(feature = "async", feature(async_await, await_macro, futures_api))]

mod macros;
mod mock;
Expand Down

0 comments on commit 7fa1cec

Please sign in to comment.