Function repeat

Source
pub fn repeat<F, T>(f: fn() -> F, interval: Duration) -> Subscription<T>
where F: Future<Output = T> + MaybeSend + 'static, T: MaybeSend + 'static,
Available on crate feature tokio or crate feature async-std or crate feature smol or WebAssembly only.
Expand description

Returns a Subscription that runs the given async function at a set interval; producing the result of the function as output.