Struct background_jobs_core::JobInfo
source · pub struct JobInfo { /* private fields */ }
Expand description
Metadata pertaining to a job that exists within the background_jobs system
Although exposed publically, this type should only really be handled by the library itself, and is impossible to create outside of a Processor’s new_job method.
Implementations
sourceimpl JobInfo
impl JobInfo
pub fn queue(&self) -> &str
pub fn id(&self) -> usize
pub fn needs_retry(&mut self) -> bool
pub fn retry_ready(&self) -> bool
pub fn is_pending(&self) -> bool
pub fn is_failed(&self) -> bool
pub fn is_finished(&self) -> bool
sourcepub fn set_running(&mut self)
pub fn set_running(&mut self)
This method sets the Job’s status to running
Touching this outside of the background_jobs crates is dangerous, since these libraries rely on the state of the job being correct.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for JobInfo
impl<'de> Deserialize<'de> for JobInfo
sourcefn 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
impl StructuralPartialEq for JobInfo
Auto Trait Implementations
impl RefUnwindSafe for JobInfo
impl Send for JobInfo
impl Sync for JobInfo
impl Unpin for JobInfo
impl UnwindSafe for JobInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more