diff options
| author | 2023-03-09 19:05:38 +0100 | |
|---|---|---|
| committer | 2023-03-09 19:05:38 +0100 | |
| commit | caf2836b1b15bff6e8a2ea72441d67f297eb8707 (patch) | |
| tree | 0ffa0d1d604780999892b88de85ee93e3ed7d539 /futures/src/backend | |
| parent | 11b2c3bbe31a43e73a61b9bd9f022233f302ae27 (diff) | |
| parent | 424ac8177309440bbd8efe0dd9f7622cb10807ce (diff) | |
| download | iced-caf2836b1b15bff6e8a2ea72441d67f297eb8707.tar.gz iced-caf2836b1b15bff6e8a2ea72441d67f297eb8707.tar.bz2 iced-caf2836b1b15bff6e8a2ea72441d67f297eb8707.zip | |
Merge pull request #1748 from iced-rs/feature/software-renderer
Software renderer, runtime renderer fallback, and core consolidation
Diffstat (limited to '')
| -rw-r--r-- | futures/src/backend/native/async_std.rs | 14 | ||||
| -rw-r--r-- | futures/src/backend/native/smol.rs | 14 | ||||
| -rw-r--r-- | futures/src/backend/native/tokio.rs | 14 | ||||
| -rw-r--r-- | futures/src/backend/wasm/wasm_bindgen.rs | 14 | 
4 files changed, 24 insertions, 32 deletions
| diff --git a/futures/src/backend/native/async_std.rs b/futures/src/backend/native/async_std.rs index b324dbf1..52b0e914 100644 --- a/futures/src/backend/native/async_std.rs +++ b/futures/src/backend/native/async_std.rs @@ -18,28 +18,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); @@ -48,7 +46,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; diff --git a/futures/src/backend/native/smol.rs b/futures/src/backend/native/smol.rs index d5201cde..30bc8291 100644 --- a/futures/src/backend/native/smol.rs +++ b/futures/src/backend/native/smol.rs @@ -19,28 +19,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 +47,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; diff --git a/futures/src/backend/native/tokio.rs b/futures/src/backend/native/tokio.rs index dd818bd1..4698a105 100644 --- a/futures/src/backend/native/tokio.rs +++ b/futures/src/backend/native/tokio.rs @@ -22,28 +22,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); @@ -52,7 +50,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; diff --git a/futures/src/backend/wasm/wasm_bindgen.rs b/futures/src/backend/wasm/wasm_bindgen.rs index b726501a..2666f1b4 100644 --- a/futures/src/backend/wasm/wasm_bindgen.rs +++ b/futures/src/backend/wasm/wasm_bindgen.rs @@ -16,6 +16,7 @@ impl crate::Executor for Executor {  pub mod time {      //! Listen and react to time. +    use crate::core::Hasher;      use crate::subscription::{self, Subscription};      use crate::BoxStream; @@ -23,22 +24,19 @@ pub mod time {      ///      /// 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, wasm_timer::Instant> { +    ) -> Subscription<wasm_timer::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 = wasm_timer::Instant; -        fn hash(&self, state: &mut H) { +        fn hash(&self, state: &mut Hasher) {              use std::hash::Hash;              std::any::TypeId::of::<Self>().hash(state); @@ -47,7 +45,7 @@ pub mod time {          fn stream(              self: Box<Self>, -            _input: BoxStream<E>, +            _input: subscription::EventStream,          ) -> BoxStream<Self::Output> {              use futures::stream::StreamExt; | 
