Skip to main content

ScheduleExt

Trait ScheduleExt 

Source
pub trait ScheduleExt {
    // Required methods
    fn job<J: Job + Clone>(&mut self, job: J) -> &mut ScheduledTask;
    fn command(
        &mut self,
        console: Arc<Console>,
        name: impl Into<String>,
    ) -> &mut ScheduledTask;
    fn command_with(
        &mut self,
        console: Arc<Console>,
        name: impl Into<String>,
        argv: impl IntoIterator<Item = impl Into<String>>,
    ) -> &mut ScheduledTask;
}
Expand description

job and command, on top of Schedule.

An extension trait rather than methods on Schedule, because the scheduler crate would otherwise have to depend on the queue and the console — and then an application with neither would compile both.

Required Methods§

Source

fn job<J: Job + Clone>(&mut self, job: J) -> &mut ScheduledTask

Dispatch a queued job on a schedule.

Source

fn command( &mut self, console: Arc<Console>, name: impl Into<String>, ) -> &mut ScheduledTask

Run a console command on a schedule.

Source

fn command_with( &mut self, console: Arc<Console>, name: impl Into<String>, argv: impl IntoIterator<Item = impl Into<String>>, ) -> &mut ScheduledTask

Run a console command with arguments.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ScheduleExt for Schedule

Source§

fn job<J: Job + Clone>(&mut self, job: J) -> &mut ScheduledTask

Source§

fn command( &mut self, console: Arc<Console>, name: impl Into<String>, ) -> &mut ScheduledTask

Source§

fn command_with( &mut self, console: Arc<Console>, name: impl Into<String>, argv: impl IntoIterator<Item = impl Into<String>>, ) -> &mut ScheduledTask

Implementors§