pub struct ArchivedJob {
pub id: JobId,
pub queue_name: String,
pub status: JobStatus,
pub created_at: DateTime<Utc>,
pub archived_at: DateTime<Utc>,
pub archival_reason: ArchivalReason,
pub original_payload_size: Option<usize>,
pub payload_compressed: bool,
pub archived_by: Option<String>,
}
Expand description
Information about an archived job.
This struct represents a job that has been moved to the archive table, containing metadata about the original job and archival information.
§Examples
use hammerwork::archive::{ArchivedJob, ArchivalReason};
use hammerwork::{JobId, JobStatus};
use chrono::Utc;
use uuid::Uuid;
let job_id = Uuid::new_v4();
let now = Utc::now();
let archived_job = ArchivedJob {
id: job_id,
queue_name: "email_queue".to_string(),
status: JobStatus::Completed,
created_at: now,
archived_at: now,
archival_reason: ArchivalReason::Automatic,
original_payload_size: Some(1024),
payload_compressed: true,
archived_by: Some("scheduler".to_string()),
};
assert_eq!(archived_job.queue_name, "email_queue");
assert_eq!(archived_job.status, JobStatus::Completed);
assert_eq!(archived_job.archival_reason, ArchivalReason::Automatic);
assert!(archived_job.payload_compressed);
Fields§
§id: JobId
Unique identifier of the archived job.
queue_name: String
Name of the queue the job belonged to.
status: JobStatus
Original job status before archiving.
created_at: DateTime<Utc>
When the job was created.
archived_at: DateTime<Utc>
When the job was archived.
archival_reason: ArchivalReason
Reason for archiving.
original_payload_size: Option<usize>
Size of the original payload in bytes.
payload_compressed: bool
Whether the payload was compressed.
archived_by: Option<String>
Who or what archived the job.
Trait Implementations§
Source§impl Clone for ArchivedJob
impl Clone for ArchivedJob
Source§fn clone(&self) -> ArchivedJob
fn clone(&self) -> ArchivedJob
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 ArchivedJob
impl Debug for ArchivedJob
Source§impl<'de> Deserialize<'de> for ArchivedJob
impl<'de> Deserialize<'de> for ArchivedJob
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
Auto Trait Implementations§
impl Freeze for ArchivedJob
impl RefUnwindSafe for ArchivedJob
impl Send for ArchivedJob
impl Sync for ArchivedJob
impl Unpin for ArchivedJob
impl UnwindSafe for ArchivedJob
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