Struct apalis_sql::context::SqlContext
source · pub struct SqlContext { /* private fields */ }Expand description
The context for a job is represented here Used to provide a context when a job is defined through the [Job] trait
Implementations§
source§impl SqlContext
impl SqlContext
sourcepub fn set_max_attempts(&mut self, max_attempts: i32)
pub fn set_max_attempts(&mut self, max_attempts: i32)
Set the number of attempts
sourcepub fn max_attempts(&self) -> i32
pub fn max_attempts(&self) -> i32
Gets the maximum attempts for a job. Default 25
sourcepub fn set_attempts(&mut self, attempts: i32)
pub fn set_attempts(&mut self, attempts: i32)
Set the number of attempts
sourcepub fn set_done_at(&mut self, done_at: Option<i64>)
pub fn set_done_at(&mut self, done_at: Option<i64>)
Set the time a job was done
sourcepub fn set_run_at(&mut self, run_at: DateTime<Utc>)
pub fn set_run_at(&mut self, run_at: DateTime<Utc>)
Set the time a job should run
sourcepub fn set_lock_at(&mut self, lock_at: Option<i64>)
pub fn set_lock_at(&mut self, lock_at: Option<i64>)
Set the lock_at value
sourcepub fn set_status(&mut self, status: State)
pub fn set_status(&mut self, status: State)
Set the job status
sourcepub fn set_lock_by(&mut self, lock_by: Option<WorkerId>)
pub fn set_lock_by(&mut self, lock_by: Option<WorkerId>)
Set lock_by
sourcepub fn last_error(&self) -> &Option<String>
pub fn last_error(&self) -> &Option<String>
Get the time a job was locked
sourcepub fn set_last_error(&mut self, error: String)
pub fn set_last_error(&mut self, error: String)
Set the last error
sourcepub fn record_attempt(&mut self)
pub fn record_attempt(&mut self)
Record an attempt to execute the request
Trait Implementations§
source§impl Clone for SqlContext
impl Clone for SqlContext
source§fn clone(&self) -> SqlContext
fn clone(&self) -> SqlContext
Returns a copy 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 moreAuto Trait Implementations§
impl RefUnwindSafe for SqlContext
impl Send for SqlContext
impl Sync for SqlContext
impl Unpin for SqlContext
impl UnwindSafe for SqlContext
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