Replace Command with a new Task API with chain support
This commit is contained in:
parent
e6d0b3bda5
commit
a25b1af456
74 changed files with 1351 additions and 1767 deletions
|
|
@ -1,8 +1,8 @@
|
|||
//! Listen to runtime events.
|
||||
use crate::core::event::{self, Event};
|
||||
use crate::core::window;
|
||||
use crate::core::MaybeSend;
|
||||
use crate::subscription::{self, Subscription};
|
||||
use crate::MaybeSend;
|
||||
|
||||
/// Returns a [`Subscription`] to all the ignored runtime events.
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
//! Choose your preferred executor to power a runtime.
|
||||
use crate::MaybeSend;
|
||||
use crate::core::MaybeSend;
|
||||
use futures::Future;
|
||||
|
||||
/// A type that can run futures.
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
use crate::core;
|
||||
use crate::core::event;
|
||||
use crate::core::keyboard::{Event, Key, Modifiers};
|
||||
use crate::core::MaybeSend;
|
||||
use crate::subscription::{self, Subscription};
|
||||
use crate::MaybeSend;
|
||||
|
||||
/// Listens to keyboard key presses and calls the given function
|
||||
/// map them into actual messages.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
pub use futures;
|
||||
pub use iced_core as core;
|
||||
|
||||
mod maybe;
|
||||
mod runtime;
|
||||
|
||||
pub mod backend;
|
||||
|
|
@ -18,7 +17,6 @@ pub mod keyboard;
|
|||
pub mod subscription;
|
||||
|
||||
pub use executor::Executor;
|
||||
pub use maybe::{MaybeSend, MaybeSync};
|
||||
pub use platform::*;
|
||||
pub use runtime::Runtime;
|
||||
pub use subscription::Subscription;
|
||||
|
|
|
|||
|
|
@ -1,35 +0,0 @@
|
|||
#[cfg(not(target_arch = "wasm32"))]
|
||||
mod platform {
|
||||
/// An extension trait that enforces `Send` only on native platforms.
|
||||
///
|
||||
/// Useful for writing cross-platform async code!
|
||||
pub trait MaybeSend: Send {}
|
||||
|
||||
impl<T> MaybeSend for T where T: Send {}
|
||||
|
||||
/// An extension trait that enforces `Sync` only on native platforms.
|
||||
///
|
||||
/// Useful for writing cross-platform async code!
|
||||
pub trait MaybeSync: Sync {}
|
||||
|
||||
impl<T> MaybeSync for T where T: Sync {}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
mod platform {
|
||||
/// An extension trait that enforces `Send` only on native platforms.
|
||||
///
|
||||
/// Useful for writing cross-platform async code!
|
||||
pub trait MaybeSend {}
|
||||
|
||||
impl<T> MaybeSend for T {}
|
||||
|
||||
/// An extension trait that enforces `Sync` only on native platforms.
|
||||
///
|
||||
/// Useful for writing cross-platform async code!
|
||||
pub trait MaybeSync {}
|
||||
|
||||
impl<T> MaybeSync for T {}
|
||||
}
|
||||
|
||||
pub use platform::{MaybeSend, MaybeSync};
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
//! Run commands and keep track of subscriptions.
|
||||
use crate::core::MaybeSend;
|
||||
use crate::subscription;
|
||||
use crate::{BoxFuture, BoxStream, Executor, MaybeSend};
|
||||
use crate::{BoxFuture, BoxStream, Executor};
|
||||
|
||||
use futures::{channel::mpsc, Sink};
|
||||
use std::marker::PhantomData;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ pub use tracker::Tracker;
|
|||
|
||||
use crate::core::event;
|
||||
use crate::core::window;
|
||||
use crate::core::MaybeSend;
|
||||
use crate::futures::{Future, Stream};
|
||||
use crate::{BoxStream, MaybeSend};
|
||||
use crate::BoxStream;
|
||||
|
||||
use futures::channel::mpsc;
|
||||
use futures::never::Never;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use crate::core::MaybeSend;
|
||||
use crate::subscription::{Event, Hasher, Recipe};
|
||||
use crate::{BoxFuture, MaybeSend};
|
||||
use crate::BoxFuture;
|
||||
|
||||
use futures::channel::mpsc;
|
||||
use futures::sink::{Sink, SinkExt};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue