pub struct SqlContext { /* private fields */ }
Expand description
The context for a job is represented here Used to provide a context for a job with an sql backend
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_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: Option<String>)
pub fn set_last_error(&mut self, error: Option<String>)
Set the last error
Sourcepub fn set_priority(&mut self, priority: i32)
pub fn set_priority(&mut self, priority: i32)
Set the job priority. Larger values will run sooner. Default is 0.
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 moreSource§impl Debug for SqlContext
impl Debug for SqlContext
Source§impl Default for SqlContext
impl Default for SqlContext
Source§impl<'de> Deserialize<'de> for SqlContext
impl<'de> Deserialize<'de> for SqlContext
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
Source§impl<Req> FromRequest<Request<Req, SqlContext>> for SqlContext
impl<Req> FromRequest<Request<Req, SqlContext>> for SqlContext
Source§fn from_request(req: &Request<Req, SqlContext>) -> Result<Self, Error>
fn from_request(req: &Request<Req, SqlContext>) -> Result<Self, Error>
Perform the extraction.
Auto Trait Implementations§
impl Freeze for SqlContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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