|
|
|
@ -59,14 +59,14 @@ pub(crate) trait Context {
|
|
|
|
|
fn context(self, message: impl Fn() -> String) -> Self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[cfg(not(target_os = "unknown"))]
|
|
|
|
|
#[cfg(all(not(target_os = "unknown"), feature = "default"))]
|
|
|
|
|
pub(crate) type Timer = smol::Timer;
|
|
|
|
|
|
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
|
|
|
#[cfg(all(target_arch = "wasm32", feature = "default"))]
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub(crate) struct Timer(wasm_timer::Delay);
|
|
|
|
|
|
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
|
|
|
#[cfg(all(target_arch = "wasm32", feature = "default"))]
|
|
|
|
|
impl Timer {
|
|
|
|
|
pub(crate) fn after(dur: std::time::Duration) -> Self {
|
|
|
|
|
Timer(wasm_timer::Delay::new(dur))
|
|
|
|
|