tokio_timer::timer

Function with_default

Source
pub fn with_default<F, R>(handle: &Handle, enter: &mut Enter, f: F) -> R
where F: FnOnce(&mut Enter) -> R,
Expand description

Set the default timer for the duration of the closure.

From within the closure, Delay instances that are created via Delay::new can be used.

ยงPanics

This function panics if there already is a default timer set.