1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! A builder pattern wrapper around the [windows-rs](https://github.com/microsoft/windows-rs) task scheduler API .
//!
//! Provides an ergonomic builder for creating the following task types:
//! - Boot
//! - Daily
//! - Event
//! - Idle
//! - Logon
//! - Monthly
//! - MonthlyDOW
//! - Registration
//! - Time
//! - Weekly
//!
//! ## Example
//!
//! ```rust
//! use chrono::prelude::*;
//! use planif::schedule::TaskCreationFlags;
//! use planif::schedule_builder::{Action, ScheduleBuilder};
//!
//! fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     let sb = ScheduleBuilder::new().unwrap();
//!     sb.create_daily()
//!         .author("planif")?
//!         .description("Daily Trigger")?
//!         .trigger("daily_trigger", true)?
//!         .days_interval(1)?
//!         .action(Action::new("test", "notepad.exe", "", ""))?
//!         .start_boundary(&Local::now().to_rfc3339())?
//!         .build()?
//!         .register("TaskName", TaskCreationFlags::CreateOrUpdate as i32)?;
//!     Ok(())
//! }
//! ```
//!
//! For more examples, refer to the `planif/examples` folder. The folder contains code for creating each of the triggers.
/// Enums used throughout the crate.
/// Errors used throughout the crate.
/// Register scheduled tasks.
/// Build different [Schedules](schedule::Schedule) for the Windows Task Scheduler.
/// Various settings available while building [Schedules](schedule::Schedule).
/// Com