pub trait ScheduleDriver: Send + Sync {
// Required methods
fn schedule(&self, entry: ScheduleEntry) -> ScheduleHandle;
fn cancel(&self, handle: &ScheduleHandle);
fn dispose(&self);
}Expand description
Driver-owned scheduling abstraction. Mirrors the TS ScheduleDriver interface
(cron/schedule-driver.ts) exactly: the driver parses the schedule, arms the timer, reschedules
cron entries after each fire, and tears everything down on ScheduleDriver::dispose. This is the
documented extension point: a custom driver (deterministic virtual-time test driver, fire-immediately
driver, etc.) fully controls timing.
Required Methods§
Sourcefn schedule(&self, entry: ScheduleEntry) -> ScheduleHandle
fn schedule(&self, entry: ScheduleEntry) -> ScheduleHandle
Schedule a callback to fire on a cron expression or at a specific time. Returns a cancellation handle.
Sourcefn cancel(&self, handle: &ScheduleHandle)
fn cancel(&self, handle: &ScheduleHandle)
Cancel a previously scheduled entry.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".