[][src]Struct dbq::Job

pub struct Job {
    pub id: u64,
    pub queue: String,
    pub class: String,
    pub args: Value,
    pub max_attempts: u32,
    pub created_at: DateTime<Utc>,
    pub run_next_at: Option<DateTime<Utc>>,
    pub last_failed_at: Option<DateTime<Utc>>,
    pub last_error: Option<String>,
    pub error_count: u32,
}

Specification and status of a job

Fields

id: u64

Unique identifier for the job within the queue

queue: String

Queue the job is part of

class: String

Type of job

args: Value

JSON arguments to the job

max_attempts: u32

Total number of times the job may be run before being moved to "dead letters" storage and no longer retried

created_at: DateTime<Utc>

Instant when the job was created

run_next_at: Option<DateTime<Utc>>

Earliest instant when the job may be run.

last_failed_at: Option<DateTime<Utc>>

Instant when the last run failed. This only ever has a non-None value when the job has been run and failed previously.

last_error: Option<String>

Error message from last failed run. This only ever has a non-None value when the job has been run and failed previously.

error_count: u32

Number of times the job has been run and failed

Methods

impl Job[src]

pub fn final_attempt(&self) -> bool[src]

If true, the job will not be retried after the current attempt and will be moved to "dead letters" storage if it fails. If false, the job will be retried on failure.

pub fn failed(&self) -> bool[src]

If true, the job has been attempted at least max_attempts times and is no longe being retried. If false, the job may have succeeded or will contintue to be retried on failure

Trait Implementations

impl Clone for Job[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Job[src]

Auto Trait Implementations

impl Send for Job

impl Sync for Job

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self