futures_time/future/
relative_future.rs

1use std::{future::Future, pin::Pin};
2
3/// A future which holds a deadline relative to now.
4///
5/// This is a future which will trigger at some point in the future. Operations
6/// such as `debounce`, which need to move their deadline forward every time an
7/// item is received from ther underlying stream. This method provides a way to
8/// ask a future to resolve at some point in the future instead.
9pub trait Timer: Future {
10    /// Move the point at which this future resolves to some point in the
11    /// future. If the future has already resolved before, calling this method
12    /// will allow it to resolve again.
13    fn reset_timer(self: Pin<&mut Self>);
14}