pub struct FailedJob {
pub id: String,
pub queue: String,
pub job_type: String,
pub payload: Value,
pub options: JobOptions,
pub error: String,
pub attempts: u32,
pub failed_at: DateTime<Utc>,
}Expand description
A job that used up its attempts (or could not run at all), as kept in
failed_jobs until it is retried or flushed.
It is also the navree-orm model of the database driver’s failed_jobs
table (FAILED_JOBS_TABLE), which the
driver writes and reads through the ORM: the payload and options are
stored as JSON text, the failure time as Unix milliseconds, and code
queries them with typed columns (FailedJob::query().where_(FailedJob::QUEUE.eq("mail"))).
Other drivers keep failed jobs their own way.
Fields§
§id: StringThe job id (the id dispatch returned).
queue: StringThe queue it was on.
job_type: StringThe job type (Job::NAME).
payload: ValueThe job value as JSON.
options: JobOptionsThe options it was dispatched with.
error: StringThe error of the last attempt.
attempts: u32How many attempts ran.
failed_at: DateTime<Utc>When it failed.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FailedJob
impl<'de> Deserialize<'de> for FailedJob
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 From<&FailedJob> for FailedJobBrief
impl From<&FailedJob> for FailedJobBrief
Source§fn from(job: &FailedJob) -> FailedJobBrief
fn from(job: &FailedJob) -> FailedJobBrief
Converts to this type from the input type.
Source§impl Model for FailedJob
impl Model for FailedJob
Source§fn values(&self) -> Result<Vec<(&'static str, Value)>>
fn values(&self) -> Result<Vec<(&'static str, Value)>>
Every column and its stored value, in field order.
Source§fn value(&self, column: &str) -> Result<Option<Value>>
fn value(&self, column: &str) -> Result<Option<Value>>
The stored value of
column; None when the model has no such
column.Source§fn set_value(&mut self, column: &str, value: Value) -> Result<()>
fn set_value(&mut self, column: &str, value: Value) -> Result<()>
Sets
column from a stored value.Source§fn touch_timestamp(&mut self, column: &str, now: DateTime<Utc>) -> Result<()>
fn touch_timestamp(&mut self, column: &str, now: DateTime<Utc>) -> Result<()>
Sets timestamp column
column to now.Source§fn timestamp_is_empty(&self, column: &str) -> bool
fn timestamp_is_empty(&self, column: &str) -> bool
Whether timestamp column
column is unset.Source§fn clear_timestamp(&mut self, column: &str)
fn clear_timestamp(&mut self, column: &str)
Unsets timestamp column
column.Source§fn timestamp_value(column: &str, now: DateTime<Utc>) -> Option<Value>
fn timestamp_value(column: &str, now: DateTime<Utc>) -> Option<Value>
The stored value of timestamp column
column at now.Source§fn relation(name: &str) -> Option<DynRelation<Self>>
fn relation(name: &str) -> Option<DynRelation<Self>>
The relation named
name, for relation paths ("company.owner" in
with, has, load, …): the ones a #[relations] impl block
declares, then the ones other modules define with
RelationRegistry.
#[derive(Model)] writes this method.Source§fn relation_names() -> Vec<Cow<'static, str>>
fn relation_names() -> Vec<Cow<'static, str>>
The names of the model’s relations (declared, then registered).
Source§fn changed_columns(&self, original: &Self) -> Result<Vec<&'static str>>
fn changed_columns(&self, original: &Self) -> Result<Vec<&'static str>>
The columns whose values differ between
self and original
(dirty tracking), compared as stored: floats within a small
tolerance, decimals numerically, date-times by instant, JSON
structurally, cast fields by their cast’s
same.Source§fn json_attribute(&self, column: &str) -> Result<Option<Value>>
fn json_attribute(&self, column: &str) -> Result<Option<Value>>
The JSON value of JSON column
column (a serde_json::Value field
or a JSON cast), for edits by path; None when the model has no
such JSON column.Source§fn accessors() -> &'static [Accessor<Self>]
fn accessors() -> &'static [Accessor<Self>]
The accessors of the model (
#[accessor] methods in an
#[accessors] impl block), which serialized records can append.Source§fn global_scopes() -> Vec<Arc<dyn GlobalScope<Self>>>
fn global_scopes() -> Vec<Arc<dyn GlobalScope<Self>>>
The global scopes applied to every query of the model
(
#[model(global_scopes(..))]).Source§fn hooks() -> Vec<Arc<dyn ModelHook<Self>>>
fn hooks() -> Vec<Arc<dyn ModelHook<Self>>>
The model’s own lifecycle hooks, run before the app’s (see
hooks).Source§fn fillable() -> &'static [&'static str]
fn fillable() -> &'static [&'static str]
The columns
fill may set, as declared (#[model(fillable(..))]).Source§fn guarded() -> Option<&'static [&'static str]>
fn guarded() -> Option<&'static [&'static str]>
The columns
fill may not set, as declared (#[model(guarded(..))]);
None when the model declares none (every column not fillable is
guarded).Source§fn is_fillable(column: &str) -> bool
fn is_fillable(column: &str) -> bool
Whether
fill may set column (or the JSON path column->path).Source§fn is_guarded(column: &str) -> bool
fn is_guarded(column: &str) -> bool
Whether
column is guarded against mass assignment.Source§fn totally_guarded() -> bool
fn totally_guarded() -> bool
Whether the model declares neither fillable nor guarded columns, so
every
fill is refused (force_fill still works).Source§fn relation_meta(name: &str) -> Option<RelationMeta>
fn relation_meta(name: &str) -> Option<RelationMeta>
What relation
name is: its kind, related model, tables and keys
(for tooling such as model:show and API documentation). Read moreSource§fn morph_name() -> Cow<'static, str>
fn morph_name() -> Cow<'static, str>
The name polymorphic type columns store for the model
(
#[model(morph_name = "...")], else the snake_case type name).Source§fn foreign_key_name() -> Cow<'static, str>
fn foreign_key_name() -> Cow<'static, str>
The default name of foreign keys to the model (
company_id): the
snake_case type name, _, the key column.Source§fn touched_relations() -> &'static [&'static str]
fn touched_relations() -> &'static [&'static str]
The relations touched when a record is saved or deleted
(
#[model(touches = [..])]).Source§fn table_name() -> &'static str
fn table_name() -> &'static str
The model’s table. Read more
Source§fn route_key_name() -> &'static str
fn route_key_name() -> &'static str
The column route model binding looks records up by: the model’s
#[model(route_key = "...")], else its key column. Read moreSource§fn query() -> Builder<Self>
fn query() -> Builder<Self>
A query of the model, with the model’s default eager loads and
relation counts (
#[model(with = [..], with_count = [..])]).Source§fn where_(filter: impl Into<Filter>) -> Builder<Self>
fn where_(filter: impl Into<Filter>) -> Builder<Self>
A query of the model with one condition (and the model’s default
eager loads and relation counts, as
query).Source§fn connection_name() -> Option<&'static str>
fn connection_name() -> Option<&'static str>
The connection the model lives on (
#[model(connection = "..")]);
None runs it on the executor’s. Given the default Db, the
model’s queries and records go to this connection.Source§fn on_connection(name: impl Into<Cow<'static, str>>) -> Builder<Self>
fn on_connection(name: impl Into<Cow<'static, str>>) -> Builder<Self>
A query of the model on connection
name, whatever the model’s
(see Builder::on_connection).Source§fn on_write_connection() -> Builder<Self>
fn on_write_connection() -> Builder<Self>
A query of the model reading from the writer, even where read
replicas exist (see
Builder::use_write). Read moreSource§fn all<E>(
exec: &E,
) -> impl Future<Output = Result<Collection<Self>, OrmError>> + Send
fn all<E>( exec: &E, ) -> impl Future<Output = Result<Collection<Self>, OrmError>> + Send
Every record.
Source§fn find<E>(
exec: &E,
key: impl Into<Self::Key>,
) -> impl Future<Output = Result<Option<Record<Self>>, OrmError>> + Send
fn find<E>( exec: &E, key: impl Into<Self::Key>, ) -> impl Future<Output = Result<Option<Record<Self>>, OrmError>> + Send
The record with key
key.Source§fn find_or_fail<E>(
exec: &E,
key: impl Into<Self::Key>,
) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
fn find_or_fail<E>( exec: &E, key: impl Into<Self::Key>, ) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
The record with key
key, or OrmError::ModelNotFound (a 404 over
HTTP).Source§fn find_many<E>(
exec: &E,
keys: impl IntoIterator<Item = impl Into<Self::Key>>,
) -> impl Future<Output = Result<Collection<Self>, OrmError>> + Send
fn find_many<E>( exec: &E, keys: impl IntoIterator<Item = impl Into<Self::Key>>, ) -> impl Future<Output = Result<Collection<Self>, OrmError>> + Send
The records with these keys (missing ones are left out).
Source§fn create<E>(
exec: &E,
model: Self,
) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
fn create<E>( exec: &E, model: Self, ) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
Inserts
model and returns its record (with any generated key and
timestamps).Source§fn insert<E>(
exec: &E,
models: impl IntoIterator<Item = Self>,
) -> impl Future<Output = Result<u64, OrmError>> + Send
fn insert<E>( exec: &E, models: impl IntoIterator<Item = Self>, ) -> impl Future<Output = Result<u64, OrmError>> + Send
Inserts
models as they are, in one statement without hooks or
change events (see Builder::insert); returns how many rows were
inserted.Source§fn insert_or_ignore<E>(
exec: &E,
models: impl IntoIterator<Item = Self>,
) -> impl Future<Output = Result<u64, OrmError>> + Send
fn insert_or_ignore<E>( exec: &E, models: impl IntoIterator<Item = Self>, ) -> impl Future<Output = Result<u64, OrmError>> + Send
Inserts
models as they are, skipping the ones that conflict with a
unique index (see Builder::insert_or_ignore).Source§fn fill_and_insert<E>(
exec: &E,
models: impl IntoIterator<Item = Self>,
) -> impl Future<Output = Result<u64, OrmError>> + Send
fn fill_and_insert<E>( exec: &E, models: impl IntoIterator<Item = Self>, ) -> impl Future<Output = Result<u64, OrmError>> + Send
Inserts
models with generated keys and timestamps, in one
statement without hooks (see Builder::fill_and_insert).Source§fn upsert<E, U>(
exec: &E,
models: impl IntoIterator<Item = Self>,
unique_by: impl IntoIterator<Item = impl ColumnName>,
update: impl IntoIterator<Item = U>,
) -> impl Future<Output = Result<u64, OrmError>> + Send
fn upsert<E, U>( exec: &E, models: impl IntoIterator<Item = Self>, unique_by: impl IntoIterator<Item = impl ColumnName>, update: impl IntoIterator<Item = U>, ) -> impl Future<Output = Result<u64, OrmError>> + Send
impl StructuralPartialEq for FailedJob
Auto Trait Implementations§
impl Forget for FailedJob
impl Freeze for FailedJob
impl RefUnwindSafe for FailedJob
impl Send for FailedJob
impl Sync for FailedJob
impl Unpin for FailedJob
impl UnsafeUnpin for FailedJob
impl UnwindSafe for FailedJob
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 moreSource§impl<M> ModelLifecycle for Mwhere
M: Model,
impl<M> ModelLifecycle for Mwhere
M: Model,
Source§fn create_quietly<E>(
exec: &E,
model: Self,
) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
fn create_quietly<E>( exec: &E, model: Self, ) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
Inserts
model and returns its record without model events
(Model::create inside without_events). Read moreSource§fn force_destroy<E>(
exec: &E,
keys: impl IntoIterator<Item = impl Into<Self::Key>>,
) -> impl Future<Output = Result<u64, OrmError>> + Send
fn force_destroy<E>( exec: &E, keys: impl IntoIterator<Item = impl Into<Self::Key>>, ) -> impl Future<Output = Result<u64, OrmError>> + Send
Source§fn restore_or_create<E>(
exec: &E,
attributes: impl IntoIterator<Item = Assignment>,
fill: impl FnOnce(&mut Self) + Send,
) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
fn restore_or_create<E>( exec: &E, attributes: impl IntoIterator<Item = Assignment>, fill: impl FnOnce(&mut Self) + Send, ) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
The record matching
attributes, soft-deleted or not, restored when
it was trashed; or a new one with them (and whatever fill sets)
inserted. See Builder::restore_or_create.Source§fn create_or_restore<E>(
exec: &E,
attributes: impl IntoIterator<Item = Assignment>,
fill: impl FnOnce(&mut Self) + Send,
) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
fn create_or_restore<E>( exec: &E, attributes: impl IntoIterator<Item = Assignment>, fill: impl FnOnce(&mut Self) + Send, ) -> impl Future<Output = Result<Record<Self>, OrmError>> + Send
Inserts a record with
attributes (and whatever fill sets), or on
a unique violation returns the record holding them, restored when it
was trashed. See
Builder::create_or_restore.Source§fn has_global_scope(name: &str) -> bool
fn has_global_scope(name: &str) -> bool
Whether the model has a global scope named
name (declared,
registered at boot, or SoftDeletes). Read moreSource§fn global_scope(name: &str) -> Option<Arc<dyn GlobalScope<Self>>>
fn global_scope(name: &str) -> Option<Arc<dyn GlobalScope<Self>>>
The global scope named
name, if the model has one.Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<M> Relationships for Mwhere
M: Model,
impl<M> Relationships for Mwhere
M: Model,
Source§fn belongs_to<R, T>(&self, foreign_key: Column<Self, T>) -> BelongsTo<Self, R>where
R: Model,
fn belongs_to<R, T>(&self, foreign_key: Column<Self, T>) -> BelongsTo<Self, R>where
R: Model,
The record of
R this record’s foreign_key column points at (by
R’s key unless owner_key says
otherwise): a deal’s company.Source§fn has_many<R, T>(&self, foreign_key: Column<R, T>) -> HasMany<Self, R>where
R: Model,
fn has_many<R, T>(&self, foreign_key: Column<R, T>) -> HasMany<Self, R>where
R: Model,
The records of
R whose foreign_key column holds this record’s
key: a deal’s activities.Source§fn belongs_to_many<R>(
&self,
table: impl Into<Cow<'static, str>>,
) -> BelongsToMany<Self, R>where
R: Model,
fn belongs_to_many<R>(
&self,
table: impl Into<Cow<'static, str>>,
) -> BelongsToMany<Self, R>where
R: Model,
The records of
R linked to this one by rows of pivot table
table, whose columns {self}_id and {related}_id hold the two
keys (see BelongsToMany for other names). The conventional
table is both models’ snake_case names in alphabetical order,
joined by _ (deal_tag).Source§fn has_one_through<R, T, A, B>(
&self,
first_key: Column<T, A>,
second_key: Column<R, B>,
) -> HasOneThrough<Self, R>
fn has_one_through<R, T, A, B>( &self, first_key: Column<T, A>, second_key: Column<R, B>, ) -> HasOneThrough<Self, R>
The record of
R reached through model T: T’s first_key
holds this record’s key, and R’s second_key holds T’s key (a
supplier’s account history through its user).Source§fn has_many_through<R, T, A, B>(
&self,
first_key: Column<T, A>,
second_key: Column<R, B>,
) -> HasManyThrough<Self, R>
fn has_many_through<R, T, A, B>( &self, first_key: Column<T, A>, second_key: Column<R, B>, ) -> HasManyThrough<Self, R>
The records of
R reached through model T: a country’s posts
through its users.Source§fn morph_one<R>(&self, name: &str) -> HasOne<Self, R>where
R: Model,
fn morph_one<R>(&self, name: &str) -> HasOne<Self, R>where
R: Model,
The record of
R whose {name}_type and {name}_id columns hold
this record’s morph name and key: a deal’s image.Source§fn morph_many<R>(&self, name: &str) -> HasMany<Self, R>where
R: Model,
fn morph_many<R>(&self, name: &str) -> HasMany<Self, R>where
R: Model,
The records of
R whose {name}_type and {name}_id columns hold
this record’s morph name and key: a deal’s comments.Source§fn morph_to(&self, name: &str) -> MorphTo<Self>
fn morph_to(&self, name: &str) -> MorphTo<Self>
The record of any model this record’s
{name}_type and {name}_id
columns point at: a comment’s commentable.Source§fn morph_to_many<R>(
&self,
name: &str,
table: impl Into<Cow<'static, str>>,
) -> BelongsToMany<Self, R>where
R: Model,
fn morph_to_many<R>(
&self,
name: &str,
table: impl Into<Cow<'static, str>>,
) -> BelongsToMany<Self, R>where
R: Model,
The records of
R linked to this one by rows of polymorphic pivot
table table (taggables: tag_id, taggable_id,
taggable_type), name being the polymorphic name (taggable).Source§fn morphed_by_many<R>(
&self,
name: &str,
table: impl Into<Cow<'static, str>>,
) -> BelongsToMany<Self, R>where
R: Model,
fn morphed_by_many<R>(
&self,
name: &str,
table: impl Into<Cow<'static, str>>,
) -> BelongsToMany<Self, R>where
R: Model,
The inverse of
morph_to_many: the
records of R that tagged this record (a tag’s deals).Source§fn through<L>(&self, local: impl Fn(&Self) -> L) -> PendingThrough<Self, L>
fn through<L>(&self, local: impl Fn(&Self) -> L) -> PendingThrough<Self, L>
A through relation composed of two relations:
self.through( Deal::company).has(Company::contacts) reaches a deal’s contacts
through its company.Source§impl<T> ValueFor<Option<T>> for T
impl<T> ValueFor<Option<T>> for T
Source§fn into_value_for(self) -> Option<T>
fn into_value_for(self) -> Option<T>
The value as the column’s type.