pub struct DbJob { /* private fields */ }Expand description
DbJob represents a job as stored in the database.
It contains all the fields from the database table but doesn’t include
the task identifier string, which is provided separately when constructing
a Job instance for use in the worker system.
Implementations§
Source§impl DbJob
impl DbJob
Sourcepub fn job_queue_id(&self) -> &Option<i32>
pub fn job_queue_id(&self) -> &Option<i32>
Foreign key to job_queues table if this job is part of a queue
Sourcepub fn attempts(&self) -> &i16
pub fn attempts(&self) -> &i16
How many times this job has been attempted Attempts started, including the current execution (1 on its first run).
Sourcepub fn max_attempts(&self) -> &i16
pub fn max_attempts(&self) -> &i16
Maximum number of retry attempts before considering the job permanently failed
Sourcepub fn last_error(&self) -> &Option<String>
pub fn last_error(&self) -> &Option<String>
Error message from the last failed attempt
Sourcepub fn created_at(&self) -> &DateTime<Utc>
pub fn created_at(&self) -> &DateTime<Utc>
When the job was created
Sourcepub fn updated_at(&self) -> &DateTime<Utc>
pub fn updated_at(&self) -> &DateTime<Utc>
When the job was last updated
Source§impl DbJob
impl DbJob
pub fn from_data(data: DbJobData) -> DbJob
pub fn into_data(self) -> DbJobData
pub fn new( id: i64, job_queue_id: Option<i32>, payload: Value, priority: i16, run_at: DateTime<Utc>, attempts: i16, max_attempts: i16, last_error: Option<String>, created_at: DateTime<Utc>, updated_at: DateTime<Utc>, key: Option<String>, revision: i32, locked_at: Option<DateTime<Utc>>, locked_by: Option<String>, flags: Option<Value>, task_id: i32, ) -> DbJob
Trait Implementations§
impl Eq for DbJob
Source§impl<'a, R> FromRow<'a, R> for DbJobwhere
R: Row,
&'a str: ColumnIndex<R>,
i64: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<i32>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Value: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
i16: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<String>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
i32: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<DateTime<Utc>>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Value>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
impl<'a, R> FromRow<'a, R> for DbJobwhere
R: Row,
&'a str: ColumnIndex<R>,
i64: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<i32>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Value: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
i16: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
DateTime<Utc>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<String>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
i32: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<DateTime<Utc>>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
Option<Value>: Decode<'a, <R as Row>::Database> + Type<<R as Row>::Database>,
impl StructuralPartialEq for DbJob
Auto Trait Implementations§
impl Freeze for DbJob
impl RefUnwindSafe for DbJob
impl Send for DbJob
impl Sync for DbJob
impl Unpin for DbJob
impl UnsafeUnpin for DbJob
impl UnwindSafe for DbJob
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more