pub struct JobRow {
pub id: String,
pub queue: String,
pub name: String,
pub payload: String,
pub attempts: i64,
pub max_attempts: i64,
pub available_at: DateTime<Utc>,
pub reserved_at: Option<DateTime<Utc>>,
pub reserved_until: Option<DateTime<Utc>>,
pub created_at: DateTime<Utc>,
pub unique_key: Option<String>,
}Expand description
A queued job, as a row.
Fields§
§id: StringThe queued job’s id.
queue: StringWhich queue it is on.
name: StringThe job’s registered name.
payload: StringIts serialised body, as JSON text.
attempts: i64How many times it has been attempted.
max_attempts: i64How many attempts it gets.
available_at: DateTime<Utc>The earliest it may run.
reserved_at: Option<DateTime<Utc>>When a worker claimed it, or NULL if it is free.
reserved_until: Option<DateTime<Utc>>When the current reservation lapses.
created_at: DateTime<Utc>When it was enqueued.
unique_key: Option<String>The uniqueness lock this job holds, if it declared a unique_id.
A column rather than something folded into the payload, because the worker needs it to release the lock and reading it should not mean deserialising the job.
Trait Implementations§
Source§impl Entity for JobRow
impl Entity for JobRow
Source§fn columns() -> &'static [ColumnSpec]
fn columns() -> &'static [ColumnSpec]
Column metadata, in declaration order. Drives both DDL generation and
the column list of generated
INSERTs.Source§fn primary_key() -> &'static str
fn primary_key() -> &'static str
The primary-key column name. Used by
find_by_pk / update /
delete_by_pk.Source§fn indexes() -> &'static [IndexSpec]
fn indexes() -> &'static [IndexSpec]
Secondary indexes (single-column and composite, unique or not),
emitted as separate
CREATE INDEX statements by crate::schema.
Defaults to none.Source§fn foreign_keys() -> &'static [ForeignKeySpec]
fn foreign_keys() -> &'static [ForeignKeySpec]
Foreign-key constraints, emitted inline in the
CREATE TABLE. These
enforce referential integrity within one database; they are not ORM
relationships (no navigation is generated). Defaults to none.Source§fn shard_columns() -> &'static [&'static str]
fn shard_columns() -> &'static [&'static str]
Columns whose values are the shard key — a shard-encoded id
(
#[orm(shard_key)]), the “user id by proxy”. When a query constrains
one of these, the repo layer routes the operation to that id’s shard. Read moreSource§fn from_row(row: &dyn Row) -> Result<Self, Error>
fn from_row(row: &dyn Row) -> Result<Self, Error>
Decode one row into
Self. Generated to read each field through its
FromColumn impl.Source§fn insert_values(&self) -> Vec<(&'static str, Value)>
fn insert_values(&self) -> Vec<(&'static str, Value)>
(column, value) pairs for an INSERT. Auto-increment primary keys
are omitted so the database assigns them.Source§impl Model for JobRow
impl Model for JobRow
Source§fn model_name() -> &'static str
fn model_name() -> &'static str
The model’s name, for error messages —
"Post".Source§fn route_key_name() -> &'static str
fn route_key_name() -> &'static str
The column route-model binding looks a member up by. Read more
impl StructuralPartialEq for JobRow
Auto Trait Implementations§
impl Freeze for JobRow
impl RefUnwindSafe for JobRow
impl Send for JobRow
impl Sync for JobRow
impl Unpin for JobRow
impl UnsafeUnpin for JobRow
impl UnwindSafe for JobRow
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> Event for T
impl<T> Event for T
Source§fn event_name() -> &'static strwhere
Self: Sized,
fn event_name() -> &'static strwhere
Self: Sized,
A human-readable name, used by wildcard listeners and log output.
Always the Rust type path; see the trait docs.