pub struct SqlContext<Pool> { /* private fields */ }Expand description
The SQL context used for jobs stored in a SQL database
Implementations§
Source§impl<Pool> SqlContext<Pool>
impl<Pool> SqlContext<Pool>
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<Pool> Clone for SqlContext<Pool>
impl<Pool> Clone for SqlContext<Pool>
Source§impl<Pool: Debug> Debug for SqlContext<Pool>
impl<Pool: Debug> Debug for SqlContext<Pool>
Source§impl<Pool> Default for SqlContext<Pool>
impl<Pool> Default for SqlContext<Pool>
Source§impl<'de, Pool> Deserialize<'de> for SqlContext<Pool>
impl<'de, Pool> Deserialize<'de> for SqlContext<Pool>
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, Pool: Sync> FromRequest<Task<Args, SqlContext<Pool>, IdType>> for SqlContext<Pool>
impl<Args: Sync, IdType: Sync, Pool: Sync> FromRequest<Task<Args, SqlContext<Pool>, IdType>> for SqlContext<Pool>
Source§type Error = Infallible
type Error = Infallible
The error type that can occur during extraction.
Source§impl<T: DeserializeOwned + Serialize, Pool> MetadataExt<T> for SqlContext<Pool>
impl<T: DeserializeOwned + Serialize, Pool> MetadataExt<T> for SqlContext<Pool>
Auto Trait Implementations§
impl<Pool> Freeze for SqlContext<Pool>
impl<Pool> RefUnwindSafe for SqlContext<Pool>where
Pool: RefUnwindSafe,
impl<Pool> Send for SqlContext<Pool>where
Pool: Send,
impl<Pool> Sync for SqlContext<Pool>where
Pool: Sync,
impl<Pool> Unpin for SqlContext<Pool>where
Pool: Unpin,
impl<Pool> UnwindSafe for SqlContext<Pool>where
Pool: UnwindSafe,
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