Skip to content

Commit 1c66b18

Browse files
committed
Add a reset stub
1 parent 5ced38b commit 1c66b18

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/delay_wasm.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use gloo_timers::future::TimeoutFuture;
44
use send_wrapper::SendWrapper;
5-
use std::{time::Duration, pin::Pin, task::{Context, Poll}, future::Future};
5+
use std::{time::{Duration, Instant}, pin::Pin, task::{Context, Poll}, future::Future};
66

77
/// A version of `Delay` that works on wasm.
88
#[derive(Debug)]
@@ -16,6 +16,10 @@ impl Delay {
1616
SendWrapper::new(TimeoutFuture::new(dur.as_millis() as u32))
1717
)
1818
}
19+
20+
/// Resets the timeout. Does nothing on wasm.
21+
#[inline]
22+
pub fn reset(&mut self, at: Instant) {}
1923
}
2024

2125
impl Future for Delay {

0 commit comments

Comments
 (0)