Trait rtic_monotonics::Monotonic
source · pub trait Monotonic {
type Instant: Ord + Copy + Add<Self::Duration, Output = Self::Instant> + Sub<Self::Duration, Output = Self::Instant, Output = Self::Duration> + Sub;
type Duration: Copy;
// Required methods
fn now() -> Self::Instant;
async fn delay(duration: Self::Duration);
async fn delay_until(instant: Self::Instant);
async fn timeout_at<F>(
instant: Self::Instant,
future: F,
) -> Result<<F as Future>::Output, TimeoutError>
where F: Future;
async fn timeout_after<F>(
duration: Self::Duration,
future: F,
) -> Result<<F as Future>::Output, TimeoutError>
where F: Future;
}
Expand description
Required Associated Types§
Required Methods§
sourceasync fn delay_until(instant: Self::Instant)
async fn delay_until(instant: Self::Instant)
Delay to some specific time instant.
sourceasync fn timeout_at<F>(
instant: Self::Instant,
future: F,
) -> Result<<F as Future>::Output, TimeoutError>where
F: Future,
async fn timeout_at<F>(
instant: Self::Instant,
future: F,
) -> Result<<F as Future>::Output, TimeoutError>where
F: Future,
Timeout at a specific time.
sourceasync fn timeout_after<F>(
duration: Self::Duration,
future: F,
) -> Result<<F as Future>::Output, TimeoutError>where
F: Future,
async fn timeout_after<F>(
duration: Self::Duration,
future: F,
) -> Result<<F as Future>::Output, TimeoutError>where
F: Future,
Timeout after a specific duration.
Object Safety§
This trait is not object safe.