Хозяйке на заметку:
fn main() {
let mut core = Core::new().expect("Can't create Tokio Core");
let handle = core.handle();
// Use only one Ctrl+C signal.
let ctrl_c = tokio_signal::ctrl_c(&handle).flatten_stream().take(1).map(|_| false);
let interval = Interval::new(Duration::from_secs(1), &handle).expect("Cann't create timer").map(|_| true);
// Process each ctrl-c as it comes in
let prog = ctrl_c
.select(interval)
.take_while(|c| Ok(*c)) // stop when Ctrl+C
.for_each(|c| {
println!("{:?}", c);
future::ok(())
});
match core.run(prog) {
Ok(o) => println!("Finish: {:?}", o),
Err(e) => println!("Error: {}", e),
};
}
там новый hyper с поддержкой токио вышел