iced_baseview 0.2.0

A baseview backend for Iced
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Listen and react to time.
pub use crate::core::time::*;

use crate::task::Task;

/// Returns a [`Task`] that produces the current [`Instant`]
/// by calling [`Instant::now`].
///
/// While you can call [`Instant::now`] directly in your application;
/// that renders your application "impure" (i.e. no referential transparency).
///
/// You may care about purity if you want to leverage the `time-travel`
/// feature properly.
pub fn now() -> Task<Instant> {
    Task::future(async { Instant::now() })
}