dtn7 0.21.0

Rust delay-tolerant-networking daemon and CLI tools implementing Bundle Protocol Version 7 (RFC9171)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use core::future::Future;
use std::time::Duration;
use tokio::time::interval;

pub async fn spawn_timer<F, Fut>(time_interval: Duration, f: F)
where
    F: Fn() -> Fut,
    //F: Send + Sync + 'static,
    Fut: Future,
{
    let mut task = interval(time_interval);
    loop {
        task.tick().await;
        f().await;
    }
}