pub struct SqlContext { /* private fields */ }Expand description
The SQL context used for jobs stored in a SQL database
Implementations§
Source§impl SqlContext
impl SqlContext
Sourcepub fn with_max_attempts(self, max_attempts: i32) -> Self
pub fn with_max_attempts(self, max_attempts: i32) -> Self
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 with_done_at(self, done_at: Option<i64>) -> Self
pub fn with_done_at(self, done_at: Option<i64>) -> Self
Set the time a job was done
Sourcepub fn with_lock_at(self, lock_at: Option<i64>) -> Self
pub fn with_lock_at(self, lock_at: Option<i64>) -> Self
Set the lock_at value
Sourcepub fn with_lock_by(self, lock_by: Option<String>) -> Self
pub fn with_lock_by(self, lock_by: Option<String>) -> Self
Set lock_by
Sourcepub fn last_result(&self) -> &Option<Value>
pub fn last_result(&self) -> &Option<Value>
Get the time a job was locked
Sourcepub fn with_last_result(self, result: Option<Value>) -> Self
pub fn with_last_result(self, result: Option<Value>) -> Self
Set the last result
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set the job priority. Larger values will run sooner. Default is 0.
Sourcepub fn with_queue(self, queue: String) -> Self
pub fn with_queue(self, queue: String) -> Self
Set the queue name
Trait Implementations§
Source§impl Clone for SqlContext
impl Clone for SqlContext
Source§fn clone(&self) -> SqlContext
fn clone(&self) -> SqlContext
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 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<Args: Sync, IdType: Sync> FromRequest<Task<Args, SqlContext, IdType>> for SqlContext
impl<Args: Sync, IdType: Sync> FromRequest<Task<Args, SqlContext, IdType>> for SqlContext
Source§type Error = Infallible
type Error = Infallible
The error type that can occur during extraction.
Source§impl<T: DeserializeOwned + Serialize> MetadataExt<T> for SqlContext
impl<T: DeserializeOwned + Serialize> MetadataExt<T> for SqlContext
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