FluenTech / embedded-time

Time(ing) library (Instant/Duration/Clock/Timer/Period/Frequency) for bare-metal embedded systems

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Async support

diondokter opened this issue · comments

Now that GATs are stable, async support can be added on stable. This would really help when writing async code.

Some of the APIs that would benefit from this are:

fn try_now(&self) -> Result<Instant<Self>, Error>;

pub fn elapsed(&self) -> Result<Dur, TimeError>

pub fn remaining(&self) -> Result<Dur, TimeError>

pub fn wait(self) -> Result<Timer<'a, OneShot, Armed, Clock, Dur>, TimeError> {

The async APIs should probably be made parallel to the existing APIs and not replace them