pub enum TaskTypeWithCompletionNotifier {
OneShot {
completion_notifier: Sender<TaskCompletion>,
},
Periodic {
interval: Duration,
completion_notifier: PeriodicCompletionNotifier,
},
}Expand description
Task type enum to distinguish between one-shot and periodic timers
任务类型枚举,用于区分一次性和周期性定时器
Variants§
OneShot
One-shot timer: executes once and completes
一次性定时器:执行一次后完成
Fields
§
completion_notifier: Sender<TaskCompletion>Periodic
Periodic timer: repeats at fixed intervals
周期性定时器:按固定间隔重复执行
Fields
§
completion_notifier: PeriodicCompletionNotifierCompletion notifier for periodic tasks
周期性任务完成通知器
Implementations§
Source§impl TaskTypeWithCompletionNotifier
impl TaskTypeWithCompletionNotifier
Sourcepub fn get_interval(&self) -> Option<Duration>
pub fn get_interval(&self) -> Option<Duration>
Get the interval for periodic tasks
Returns None for one-shot tasks
获取周期任务的间隔时间
对于一次性任务返回 None
Auto Trait Implementations§
impl Freeze for TaskTypeWithCompletionNotifier
impl !RefUnwindSafe for TaskTypeWithCompletionNotifier
impl Send for TaskTypeWithCompletionNotifier
impl Sync for TaskTypeWithCompletionNotifier
impl Unpin for TaskTypeWithCompletionNotifier
impl !UnwindSafe for TaskTypeWithCompletionNotifier
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