Skip to main content

Schedule

Struct Schedule 

Source
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

Source

pub fn schedule_name(&self) -> &str

The schedule’s name, unique across every application sharing the database.

Source

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.

Source

pub fn workflow(&self) -> &QualifiedWorkflowName

The workflow each tick enqueues.

Source

pub fn schedule(&self) -> &str

The cron expression.

Source

pub fn status(&self) -> ScheduleStatus

Whether the schedule is firing or paused.

Source

pub fn context(&self) -> &str

The context each tick is called with, encoded.

Source

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.

Source

pub fn last_fired_at(&self) -> Option<SystemTime>

The tick the schedule last fired for, or None if it has not fired.

Source

pub fn automatic_backfill(&self) -> bool

Whether an executor picking the schedule up first enqueues the ticks it missed.

Source

pub fn cron_timezone(&self) -> Option<&str>

The IANA timezone the cron expression is read in, or None for UTC.

Source

pub fn queue_name(&self) -> Option<&str>

The queue each tick is enqueued on, or None for the engine’s internal queue.

Source

pub fn app_name(&self) -> Option<&str>

The application that owns the schedule, or None if it is unclaimed and every application sharing the database fires it.

Trait Implementations§

Source§

impl Clone for Schedule

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Schedule

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Schedule

Source§

impl PartialEq for Schedule

Two views are equal when they read the same row: which serializer reads the context is not part of the schedule.

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more