pub struct NotificationScheduler { /* private fields */ }Expand description
Schedules notification deliveries
Implementations§
Source§impl NotificationScheduler
impl NotificationScheduler
Sourcepub fn new(
notifier: Arc<dyn Notifier>,
scheduler: Arc<Scheduler>,
) -> NotificationScheduler
pub fn new( notifier: Arc<dyn Notifier>, scheduler: Arc<Scheduler>, ) -> NotificationScheduler
Creates a new scheduler that uses the provided notifier to deliver notifications
Sourcepub fn notify_with_fixed_interval<I>(
&self,
id: NotificationId,
interval: Duration,
initial_delay: I,
name: Option<String>,
) -> ScheduleEntryId
pub fn notify_with_fixed_interval<I>( &self, id: NotificationId, interval: Duration, initial_delay: I, name: Option<String>, ) -> ScheduleEntryId
Schedules recurring notification deliveries with fixed intervals
Sourcepub fn notify_once_after_delay(
&self,
id: NotificationId,
delay: Duration,
name: Option<String>,
) -> ScheduleEntryId
pub fn notify_once_after_delay( &self, id: NotificationId, delay: Duration, name: Option<String>, ) -> ScheduleEntryId
Schedules a one-time notification delivery
Sourcepub fn cancel(&self, id: ScheduleEntryId)
pub fn cancel(&self, id: ScheduleEntryId)
Cancels future notification(s)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NotificationScheduler
impl !RefUnwindSafe for NotificationScheduler
impl Send for NotificationScheduler
impl Sync for NotificationScheduler
impl Unpin for NotificationScheduler
impl !UnwindSafe for NotificationScheduler
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