pub struct Schedule { /* private fields */ }Expand description
A schedule, as the database holds it.
What get_schedule and list_schedules return:
the definition a ScheduleSpec wrote, and the state the scheduler keeps beside it — whether
it is paused, and when it last fired.
The context is kept encoded, and decode_context decodes it on request:
a schedule written by another SDK, or under another serializer, may hold a context this one
cannot read, and listing it should not fail for that.
Implementations§
Source§impl Schedule
impl Schedule
Sourcepub fn schedule_name(&self) -> &str
pub fn schedule_name(&self) -> &str
The schedule’s name, unique across every application sharing the database.
Sourcepub fn id(&self) -> &str
pub fn id(&self) -> &str
The id the database generated for the schedule. A schedule deleted and created again under the same name has a new one.
Sourcepub fn workflow(&self) -> &QualifiedWorkflowName
pub fn workflow(&self) -> &QualifiedWorkflowName
The workflow each tick enqueues.
Sourcepub fn status(&self) -> ScheduleStatus
pub fn status(&self) -> ScheduleStatus
Whether the schedule is firing or paused.
Sourcepub fn decode_context<C: DeserializeOwned>(&self) -> Result<C>
pub fn decode_context<C: DeserializeOwned>(&self) -> Result<C>
The context each tick is called with, decoded as C.
Read with the configured Serializer. The column carries no tag, so
a context written under another serializer — including one written before a
CustomSerializer was configured — is read as if this one had
written it: it fails to decode, or decodes to something else.
Sourcepub fn last_fired_at(&self) -> Option<SystemTime>
pub fn last_fired_at(&self) -> Option<SystemTime>
The tick the schedule last fired for, or None if it has not fired.
Sourcepub fn automatic_backfill(&self) -> bool
pub fn automatic_backfill(&self) -> bool
Whether an executor picking the schedule up first enqueues the ticks it missed.
Sourcepub fn cron_timezone(&self) -> Option<&str>
pub fn cron_timezone(&self) -> Option<&str>
The IANA timezone the cron expression is read in, or None for UTC.
Sourcepub fn queue_name(&self) -> Option<&str>
pub fn queue_name(&self) -> Option<&str>
The queue each tick is enqueued on, or None for the engine’s internal queue.
Trait Implementations§
impl Eq for Schedule
Auto Trait Implementations§
impl !RefUnwindSafe for Schedule
impl !UnwindSafe for Schedule
impl Forget for Schedule
impl Freeze for Schedule
impl Send for Schedule
impl Sync for Schedule
impl Unpin for Schedule
impl UnsafeUnpin for Schedule
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> ⓘ
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> ⓘ
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