File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ debug = []
1414twox-hash = { version = " 1.5" , default-features = false }
1515unicode-segmentation = " 1.6"
1616num-traits = " 0.2"
17- instant = { version =" 0.1" , features =[" wasm-bindgen" ] }
1817
1918[dependencies .iced_core ]
2019version = " 0.4"
@@ -28,3 +27,7 @@ features = ["thread-pool"]
2827[dependencies .iced_style ]
2928version = " 0.3"
3029path = " ../style"
30+
31+ [target .'cfg(target_arch = "wasm32")' .dependencies .instant ]
32+ version = " 0.1"
33+ features = [" wasm-bindgen" ]
Original file line number Diff line number Diff line change 11#![ allow( missing_docs) ]
2- use std:: { collections:: VecDeque , time} ;
2+ use crate :: time;
3+
4+ use std:: collections:: VecDeque ;
35
46/// A bunch of time measurements for debugging purposes.
57#[ derive( Debug ) ]
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ pub mod renderer;
4949pub mod subscription;
5050pub mod svg;
5151pub mod text;
52+ pub mod time;
5253pub mod touch;
5354pub mod user_interface;
5455pub mod widget;
Original file line number Diff line number Diff line change 11//! Track mouse clicks.
2+ use crate :: time:: Instant ;
23use crate :: Point ;
3- use instant:: Instant ;
44
55/// A mouse click.
66#[ derive( Debug , Clone , Copy ) ]
Original file line number Diff line number Diff line change 1+ //! Keep track of time, both in native and web platforms!
2+
3+ #[ cfg( target_arch = "wasm32" ) ]
4+ pub use instant:: { Duration , Instant } ;
5+
6+ #[ cfg( not( target_arch = "wasm32" ) ) ]
7+ pub use std:: time:: { Duration , Instant } ;
Original file line number Diff line number Diff line change 11//! Listen and react to time.
2+ pub use crate :: runtime:: time:: { Duration , Instant } ;
3+
24use crate :: Subscription ;
35
46/// Returns a [`Subscription`] that produces messages at a set interval.
57///
68/// The first message is produced after a `duration`, and then continues to
79/// produce more messages every `duration` after that.
8- pub fn every (
9- duration : std:: time:: Duration ,
10- ) -> Subscription < std:: time:: Instant > {
10+ pub fn every ( duration : Duration ) -> Subscription < Instant > {
1111 iced_futures:: time:: every ( duration)
1212}
You can’t perform that action at this time.
0 commit comments