Merge pull request #595 from valbendan/master
upgrade tokio to latest version(v0.3)
This commit is contained in:
commit
87c9df294c
12 changed files with 72 additions and 13 deletions
|
|
@ -7,13 +7,23 @@ pub use platform::Default;
|
|||
mod platform {
|
||||
use iced_futures::{executor, futures};
|
||||
|
||||
#[cfg(feature = "tokio")]
|
||||
#[cfg(feature = "tokio_old")]
|
||||
type Executor = executor::TokioOld;
|
||||
|
||||
#[cfg(all(not(feature = "tokio_old"), feature = "tokio"))]
|
||||
type Executor = executor::Tokio;
|
||||
|
||||
#[cfg(all(not(feature = "tokio"), feature = "async-std"))]
|
||||
#[cfg(all(
|
||||
not(any(feature = "tokio_old", feature = "tokio")),
|
||||
feature = "async-std"
|
||||
))]
|
||||
type Executor = executor::AsyncStd;
|
||||
|
||||
#[cfg(not(any(feature = "tokio", feature = "async-std")))]
|
||||
#[cfg(not(any(
|
||||
feature = "tokio_old",
|
||||
feature = "tokio",
|
||||
feature = "async-std"
|
||||
)))]
|
||||
type Executor = executor::ThreadPool;
|
||||
|
||||
/// A default cross-platform executor.
|
||||
|
|
@ -40,7 +50,7 @@ mod platform {
|
|||
}
|
||||
|
||||
fn enter<R>(&self, f: impl FnOnce() -> R) -> R {
|
||||
self.0.enter(f)
|
||||
super::Executor::enter(&self.0, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
11
src/lib.rs
11
src/lib.rs
|
|
@ -193,10 +193,17 @@ pub mod widget;
|
|||
pub mod window;
|
||||
|
||||
#[cfg(all(
|
||||
any(feature = "tokio", feature = "async-std"),
|
||||
any(feature = "tokio", feature = "tokio_old", feature = "async-std"),
|
||||
not(target_arch = "wasm32")
|
||||
))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(feature = "tokio", feature = "async-std"))))]
|
||||
#[cfg_attr(
|
||||
docsrs,
|
||||
doc(cfg(any(
|
||||
feature = "tokio",
|
||||
feature = "tokio_old",
|
||||
feature = "async-std"
|
||||
)))
|
||||
)]
|
||||
pub mod time;
|
||||
|
||||
#[cfg(all(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue