pub struct RunningJob(pub Arc<RunningJobData>);
Expand description
Information about a running job.
Tuple Fields§
§0: Arc<RunningJobData>
Methods from Deref<Target = RunningJobData>§
Sourcepub async fn checkpoint_blob(
&self,
new_payload: Vec<u8>,
) -> Result<OffsetDateTime>
pub async fn checkpoint_blob( &self, new_payload: Vec<u8>, ) -> Result<OffsetDateTime>
Checkpoint the task, replacing the payload with the passed in value.
Sourcepub async fn checkpoint_json<T: Serialize>(
&self,
new_payload: T,
) -> Result<OffsetDateTime>
pub async fn checkpoint_json<T: Serialize>( &self, new_payload: T, ) -> Result<OffsetDateTime>
Checkpoint the task, replacing the payload with the passed in value.
Sourcepub async fn heartbeat(&self) -> Result<OffsetDateTime>
pub async fn heartbeat(&self) -> Result<OffsetDateTime>
Tell the queue that the task is still running.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Return if the task is past the expiration time or not.
Sourcepub fn json_payload<'a, T: Deserialize<'a>>(&'a self) -> Result<T>
pub fn json_payload<'a, T: Deserialize<'a>>(&'a self) -> Result<T>
Deserialize a JSON payload into the requested type.
Trait Implementations§
Source§impl Clone for RunningJob
impl Clone for RunningJob
Source§fn clone(&self) -> RunningJob
fn clone(&self) -> RunningJob
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RunningJob
impl Debug for RunningJob
Source§impl Deref for RunningJob
impl Deref for RunningJob
Auto Trait Implementations§
impl Freeze for RunningJob
impl !RefUnwindSafe for RunningJob
impl Send for RunningJob
impl Sync for RunningJob
impl Unpin for RunningJob
impl !UnwindSafe for RunningJob
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