pub struct Timer<Message: Clone + Send + 'static> { /* private fields */ }Expand description
A simple timer that sends a given message on a regular interval.
Implementations§
Source§impl<T: Clone + Send + 'static> Timer<T>
impl<T: Clone + Send + 'static> Timer<T>
Sourcepub fn new(interval: Duration, message: T) -> Self
pub fn new(interval: Duration, message: T) -> Self
Create a timer that sends the given message at the given interval.
The first message will be sent after duration.
Auto Trait Implementations§
impl<Message> Freeze for Timer<Message>where
Message: Freeze,
impl<Message> !RefUnwindSafe for Timer<Message>
impl<Message> Send for Timer<Message>
impl<Message> Sync for Timer<Message>where
Message: Sync,
impl<Message> Unpin for Timer<Message>where
Message: Unpin,
impl<Message> !UnwindSafe for Timer<Message>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more