pub struct JobSchedule {
pub kind: String,
pub next_run_at: Timestamp,
pub version: u64,
}Expand description
When a recurring job next falls due: one row per schedule, shared by every worker.
Fields§
§kind: StringThe Job::KIND it enqueues.
next_run_at: Timestamp§version: u64Implementations§
Source§impl JobSchedule
impl JobSchedule
Sourcepub fn fields() -> JobScheduleFields<JobSchedule>
pub fn fields() -> JobScheduleFields<JobSchedule>
Returns a handle used to reference JobSchedule’s fields when building query expressions.
Sourcepub async fn get_by_kind(
executor: &mut dyn Executor,
kind: impl IntoExpr<FieldExprTarget<String>>,
) -> Result<JobSchedule>
pub async fn get_by_kind( executor: &mut dyn Executor, kind: impl IntoExpr<FieldExprTarget<String>>, ) -> Result<JobSchedule>
Fetches the single JobSchedule where kind matches, erroring if none exists.
Sourcepub fn update_by_kind(
kind: impl IntoExpr<FieldExprTarget<String>>,
) -> JobScheduleUpdate
pub fn update_by_kind( kind: impl IntoExpr<FieldExprTarget<String>>, ) -> JobScheduleUpdate
Returns a builder that updates the JobSchedule where kind matches.
Sourcepub async fn delete_by_kind(
executor: &mut dyn Executor,
kind: impl IntoExpr<FieldExprTarget<String>>,
) -> Result<()>
pub async fn delete_by_kind( executor: &mut dyn Executor, kind: impl IntoExpr<FieldExprTarget<String>>, ) -> Result<()>
Deletes the JobSchedule where kind matches.
Sourcepub fn filter_by_kind(
kind: impl IntoExpr<FieldExprTarget<String>>,
) -> JobScheduleQuery
pub fn filter_by_kind( kind: impl IntoExpr<FieldExprTarget<String>>, ) -> JobScheduleQuery
Returns a query selecting the JobSchedule records where kind matches.
Sourcepub fn create() -> JobScheduleCreate
pub fn create() -> JobScheduleCreate
Returns a builder that inserts a new JobSchedule record.
Typically constructed through the toasty::create! macro.
Sourcepub fn create_many() -> CreateMany<JobSchedule>
pub fn create_many() -> CreateMany<JobSchedule>
Returns a builder that inserts multiple JobSchedule records at once.
Sourcepub fn update(&mut self) -> JobScheduleUpdate<&mut Self>
pub fn update(&mut self) -> JobScheduleUpdate<&mut Self>
Returns a builder that updates this JobSchedule record in place.
Source§impl JobSchedule
impl JobSchedule
Sourcepub fn upsert_by_kind(
kind: impl IntoExpr<FieldExprTarget<String>>,
) -> JobScheduleUpsertByKind
pub fn upsert_by_kind( kind: impl IntoExpr<FieldExprTarget<String>>, ) -> JobScheduleUpsertByKind
Returns a builder that creates JobSchedule or updates the record whose kind constraint matches.
The target arguments initialize a new record and remain unchanged when an existing record is updated.
Trait Implementations§
Source§impl Assign<JobSchedule> for JobSchedule
impl Assign<JobSchedule> for JobSchedule
Source§fn into_assignment(self) -> Assignment<JobSchedule>
fn into_assignment(self) -> Assignment<JobSchedule>
Assignment<T>] value.Source§impl Clone for JobSchedule
impl Clone for JobSchedule
Source§impl Debug for JobSchedule
impl Debug for JobSchedule
Source§impl IntoExpr<JobSchedule> for JobSchedule
impl IntoExpr<JobSchedule> for JobSchedule
Source§fn into_expr(self) -> Expr<JobSchedule>
fn into_expr(self) -> Expr<JobSchedule>
Source§fn by_ref(&self) -> Expr<JobSchedule>
fn by_ref(&self) -> Expr<JobSchedule>
Source§impl IntoStatement for &JobSchedule
impl IntoStatement for &JobSchedule
Source§type Returning = JobSchedule
type Returning = JobSchedule
Source§fn into_statement(self) -> Statement<JobSchedule>
fn into_statement(self) -> Statement<JobSchedule>
self and produce the [Statement].Source§impl IntoStatement for &mut JobSchedule
impl IntoStatement for &mut JobSchedule
Source§type Returning = JobSchedule
type Returning = JobSchedule
Source§fn into_statement(self) -> Statement<JobSchedule>
fn into_statement(self) -> Statement<JobSchedule>
self and produce the [Statement].Source§impl IntoStatement for JobSchedule
impl IntoStatement for JobSchedule
Source§type Returning = JobSchedule
type Returning = JobSchedule
Source§fn into_statement(self) -> Statement<JobSchedule>
fn into_statement(self) -> Statement<JobSchedule>
self and produce the [Statement].Source§impl Load for JobSchedule
impl Load for JobSchedule
Source§fn reload(target: &mut Self, value: Value) -> Result<()>
fn reload(target: &mut Self, value: Value) -> Result<()>
§fn ty_relation() -> Type
fn ty_relation() -> Type
stmt::Type] used when this type appears as a relation
target. The default delegates to ty().§fn load_relation(value: Value) -> Result<Self::Output, Error>
fn load_relation(value: Value) -> Result<Self::Output, Error>
Source§impl Model for JobSchedule
impl Model for JobSchedule
Source§type Query<__T> = JobScheduleQuery<__T>
type Query<__T> = JobScheduleQuery<__T>
Source§type Update<'a> = JobScheduleUpdate<&'a mut JobSchedule>
type Update<'a> = JobScheduleUpdate<&'a mut JobSchedule>
Source§type UpdateQuery = JobScheduleUpdate
type UpdateQuery = JobScheduleUpdate
Source§type PrimaryKey = String
type PrimaryKey = String
Source§type ManyField<__Origin> = JobScheduleListFields<__Origin>
type ManyField<__Origin> = JobScheduleListFields<__Origin>
Source§type OneField<__Origin, __Target> = JobScheduleFields<__Origin, __Target>
type OneField<__Origin, __Target> = JobScheduleFields<__Origin, __Target>
Source§fn register(model_set: &mut ModelSet)
fn register(model_set: &mut ModelSet)
ModelSet]. Read moreSource§fn new_path<__Origin>(path: Path<__Origin, Self>) -> Self::Path<__Origin>
fn new_path<__Origin>(path: Path<__Origin, Self>) -> Self::Path<__Origin>
Path] targeting this model.Source§fn new_many_field<__Origin>(
path: Path<__Origin, List<Self>>,
) -> JobScheduleListFields<__Origin>
fn new_many_field<__Origin>( path: Path<__Origin, List<Self>>, ) -> JobScheduleListFields<__Origin>
ManyField from a path targeting a list
of this model.Source§fn find_by_primary_key(id: Expr<Self::PrimaryKey>) -> Self::Query<List<Self>>
fn find_by_primary_key(id: Expr<Self::PrimaryKey>) -> Self::Query<List<Self>>
Source§fn wrap_query<__T>(stmt: Query<__T>) -> Self::Query<__T>
fn wrap_query<__T>(stmt: Query<__T>) -> Self::Query<__T>
Query in this model’s
query builder, preserving the result shape T. This is the single
constructor generic code uses to build any query shape; callers narrow
at the statement level (.one(), .first()) before wrapping.Source§fn query_one(query: Self::Query<List<Self>>) -> Self::Query<Self>
fn query_one(query: Self::Query<List<Self>>) -> Self::Query<Self>
Source§fn query_first(query: Self::Query<List<Self>>) -> Self::Query<Option<Self>>
fn query_first(query: Self::Query<List<Self>>) -> Self::Query<Option<Self>>
Source§fn field_name_to_id(name: &str) -> FieldId
fn field_name_to_id(name: &str) -> FieldId
FieldId]. Read more§fn new_root_path() -> Self::Path<Self>
fn new_root_path() -> Self::Path<Self>
§fn path_field<U>(index: usize) -> Path<Self, U>
fn path_field<U>(index: usize) -> Path<Self, U>
Path] from this model to the field at index.§fn path_model_list() -> Path<List<Self>, List<Self>>
fn path_model_list() -> Path<List<Self>, List<Self>>
Path] rooted at a list of this model, used as the root of
has-many relation scopes.§fn new_create() -> Self::Create
fn new_create() -> Self::Create
Source§impl ModelCodegen for JobSchedule
impl ModelCodegen for JobSchedule
Source§fn to_relation_expr(&self, fields: &[&str]) -> Expr
fn to_relation_expr(&self, fields: &[&str]) -> Expr
Source§fn new_one_field<__Origin, __Target>(
path: Path<__Origin, __Target>,
) -> Self::OneField<__Origin, __Target>
fn new_one_field<__Origin, __Target>( path: Path<__Origin, __Target>, ) -> Self::OneField<__Origin, __Target>
Source§impl UpdateTarget for &mut JobSchedule
impl UpdateTarget for &mut JobSchedule
Source§type Returning = JobSchedule
type Returning = JobSchedule
Update<R> statement.Source§fn to_update_stmt(&mut self, assignments: Assignments) -> Update<JobSchedule>
fn to_update_stmt(&mut self, assignments: Assignments) -> Update<JobSchedule>
Source§fn apply_result(self, value: Value) -> Result<()>
fn apply_result(self, value: Value) -> Result<()>
Source§impl ViaTarget for JobSchedule
impl ViaTarget for JobSchedule
Source§type Query = JobScheduleQuery
type Query = JobScheduleQuery
Source§type Path<__Origin> = <JobSchedule as Model>::ManyField<__Origin>
type Path<__Origin> = <JobSchedule as Model>::ManyField<__Origin>
#[has_many(via = …)] field’s accessor returns,
parameterized by the origin model. Mirrors Model::Path for the
via-many case. Read moreSource§fn new_path<__Origin>(
path: Path<__Origin, List<JobSchedule>>,
) -> Self::Path<__Origin>
fn new_path<__Origin>( path: Path<__Origin, List<JobSchedule>>, ) -> Self::Path<__Origin>
Path handle from the typed path reaching this
terminal. A model terminal wraps the path in its chainable ManyField; a
scalar terminal is a leaf, so the path is the handle.Source§fn via_field_ty(singular: Name, path: Path) -> FieldTy
fn via_field_ty(singular: Name, path: Path) -> FieldTy
FieldTy::Via] for a #[has_many(via = …)] field whose
terminal element type is Self. Read moreSource§fn make_via_query(assoc: Association<List<JobSchedule>>) -> Self::Query
fn make_via_query(assoc: Association<List<JobSchedule>>) -> Self::Query
Auto Trait Implementations§
impl Freeze for JobSchedule
impl RefUnwindSafe for JobSchedule
impl Send for JobSchedule
impl Sync for JobSchedule
impl Unpin for JobSchedule
impl UnsafeUnpin for JobSchedule
impl UnwindSafe for JobSchedule
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<M> RelationOneField for Mwhere
M: Model,
impl<M> RelationOneField for Mwhere
M: Model,
§type One = <M as Model>::Query<M>
type One = <M as Model>::Query<M>
<Target as Model>::Query<Target>; for nullable impls it is
<Target as Model>::Query<Option<Target>>.§type Expr = M
type Expr = M
Self::Target for non-nullable impls and
Option<Self::Target> for nullable impls.§fn make_one(
query: <<M as RelationOneField>::Target as Model>::Query<List<<M as RelationOneField>::Target>>,
) -> <M as RelationOneField>::One
fn make_one( query: <<M as RelationOneField>::Target as Model>::Query<List<<M as RelationOneField>::Target>>, ) -> <M as RelationOneField>::One
Query<Model> for non-nullable impls and
Query<Option<Model>> for nullable impls. Read more§fn reload(target: &mut Self, value: Value) -> Result<(), Error>
fn reload(target: &mut Self, value: Value) -> Result<(), Error>
§fn has_one_relation_field_ty(
pair: Option<FieldId>,
via: Option<Path>,
) -> FieldTy
fn has_one_relation_field_ty( pair: Option<FieldId>, via: Option<Path>, ) -> FieldTy
FieldTy] for a HasOne relation field, given an
optional paired BelongsTo field on the target model resolved
from #[has_one(pair = <field>)]. When None, the linker selects
the pair by searching the target for a unique BelongsTo back to
the source. Read more§fn belongs_to_relation_field_ty(foreign_key: ForeignKey) -> FieldTy
fn belongs_to_relation_field_ty(foreign_key: ForeignKey) -> FieldTy
FieldTy] for a BelongsTo relation field, given the
foreign key resolved from the field’s #[belongs_to(...)] attribute.