summaryrefslogtreecommitdiffstats
path: root/futures/src/backend/native/smol.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-07-12 12:23:18 -0700
committerLibravatar Bingus <shankern@protonmail.com>2023-07-12 12:23:18 -0700
commit633f405f3f78bc7f82d2b2061491b0e011137451 (patch)
tree5ebfc1f45d216a5c14a90492563599e6969eab4d /futures/src/backend/native/smol.rs
parent41836dd80d0534608e7aedfbf2319c540a23de1a (diff)
parent21bd51426d900e271206f314e0c915dd41065521 (diff)
downloadiced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.gz
iced-633f405f3f78bc7f82d2b2061491b0e011137451.tar.bz2
iced-633f405f3f78bc7f82d2b2061491b0e011137451.zip
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts: # Cargo.toml # core/src/window/icon.rs # core/src/window/id.rs # core/src/window/position.rs # core/src/window/settings.rs # examples/integration/src/main.rs # examples/integration_opengl/src/main.rs # glutin/src/application.rs # native/src/subscription.rs # native/src/window.rs # runtime/src/window/action.rs # src/lib.rs # src/window.rs # winit/Cargo.toml # winit/src/application.rs # winit/src/icon.rs # winit/src/settings.rs # winit/src/window.rs
Diffstat (limited to 'futures/src/backend/native/smol.rs')
-rw-r--r--futures/src/backend/native/smol.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/futures/src/backend/native/smol.rs b/futures/src/backend/native/smol.rs
index d5201cde..00d13d35 100644
--- a/futures/src/backend/native/smol.rs
+++ b/futures/src/backend/native/smol.rs
@@ -1,9 +1,7 @@
//! A `smol` backend.
-
use futures::Future;
/// A `smol` executor.
-#[cfg_attr(docsrs, doc(cfg(feature = "smol")))]
#[derive(Debug)]
pub struct Executor;
@@ -19,28 +17,26 @@ impl crate::Executor for Executor {
pub mod time {
//! Listen and react to time.
+ use crate::core::Hasher;
use crate::subscription::{self, Subscription};
/// Returns a [`Subscription`] that produces messages at a set interval.
///
/// The first message is produced after a `duration`, and then continues to
/// produce more messages every `duration` after that.
- pub fn every<H: std::hash::Hasher, E>(
+ pub fn every(
duration: std::time::Duration,
- ) -> Subscription<H, E, std::time::Instant> {
+ ) -> Subscription<std::time::Instant> {
Subscription::from_recipe(Every(duration))
}
#[derive(Debug)]
struct Every(std::time::Duration);
- impl<H, E> subscription::Recipe<H, E> for Every
- where
- H: std::hash::Hasher,
- {
+ impl subscription::Recipe for Every {
type Output = std::time::Instant;
- fn hash(&self, state: &mut H) {
+ fn hash(&self, state: &mut Hasher) {
use std::hash::Hash;
std::any::TypeId::of::<Self>().hash(state);
@@ -49,7 +45,7 @@ pub mod time {
fn stream(
self: Box<Self>,
- _input: futures::stream::BoxStream<'static, E>,
+ _input: subscription::EventStream,
) -> futures::stream::BoxStream<'static, Self::Output> {
use futures::stream::StreamExt;