pub struct BasicEvent<F, T>{
pub task: F,
pub state: T,
}Expand description
A basic scheduled event. task will be called once when added to the scheduler.
A mutable reference to state will be passed to task on each call.
if task returns Some(Duration), task will be rerun after that amount of time has passed.
if task returns None, the BasicEvent will be dropped
Fields§
§task: F§state: TTrait Implementations§
Auto Trait Implementations§
impl<F, T> Freeze for BasicEvent<F, T>
impl<F, T> RefUnwindSafe for BasicEvent<F, T>where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<F, T> Send for BasicEvent<F, T>
impl<F, T> Sync for BasicEvent<F, T>
impl<F, T> Unpin for BasicEvent<F, T>
impl<F, T> UnwindSafe for BasicEvent<F, T>where
F: UnwindSafe,
T: UnwindSafe,
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