pub struct ScheduledJob {
    pub id: String,
    pub cron: CronExpression,
    pub job_type: String,
    pub payload: Value,
    pub priority: Priority,
    pub retry_strategy: RetryStrategy,
    pub timeout: Duration,
    pub enabled: bool,
    pub description: Option<String>,
    pub next_run: Option<DateTime<Utc>>,
    pub last_run: Option<DateTime<Utc>>,
    pub created_at: DateTime<Utc>,
}Expand description
Scheduled job configuration
Fields§
§id: StringUnique identifier for this scheduled job
cron: CronExpressionCron expression for when to run
job_type: StringJob type to execute
payload: ValueJob payload (serialized)
priority: PriorityJob priority
retry_strategy: RetryStrategyRetry strategy configuration
timeout: DurationJob timeout
enabled: boolWhether this schedule is active
description: Option<String>Optional description
next_run: Option<DateTime<Utc>>Next scheduled run time
last_run: Option<DateTime<Utc>>Last execution time
created_at: DateTime<Utc>When this schedule was created
Implementations§
Source§impl ScheduledJob
 
impl ScheduledJob
Sourcepub fn new<T: Job>(
    id: String,
    cron_expr: &str,
    job: T,
    priority: Option<Priority>,
    retry_strategy: Option<RetryStrategy>,
) -> ScheduleResult<Self>
 
pub fn new<T: Job>( id: String, cron_expr: &str, job: T, priority: Option<Priority>, retry_strategy: Option<RetryStrategy>, ) -> ScheduleResult<Self>
Create a new scheduled job
Sourcepub fn update_next_run(&mut self)
 
pub fn update_next_run(&mut self)
Update next run time
Sourcepub fn should_run(&self) -> bool
 
pub fn should_run(&self) -> bool
Check if this job should run now
Sourcepub fn mark_executed(&mut self)
 
pub fn mark_executed(&mut self)
Mark as executed
Sourcepub fn create_job_entry(&self) -> QueueResult<JobEntry>
 
pub fn create_job_entry(&self) -> QueueResult<JobEntry>
Create a job entry for execution
Trait Implementations§
Source§impl Clone for ScheduledJob
 
impl Clone for ScheduledJob
Source§fn clone(&self) -> ScheduledJob
 
fn clone(&self) -> ScheduledJob
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moreSource§impl Debug for ScheduledJob
 
impl Debug for ScheduledJob
Source§impl<'de> Deserialize<'de> for ScheduledJob
 
impl<'de> Deserialize<'de> for ScheduledJob
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ScheduledJob
impl RefUnwindSafe for ScheduledJob
impl Send for ScheduledJob
impl Sync for ScheduledJob
impl Unpin for ScheduledJob
impl UnwindSafe for ScheduledJob
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