pub struct CalendarSpec {
pub at: String,
pub days: Vec<String>,
}Expand description
Calendar time trigger (#418 Phase 2). at is either a time of
day ("HH:MM", repeating — combine with days) or a full
date+time ("YYYY-MM-DD HH:MM", a one-shot that fires once and
never again). Evaluated in the schedule’s top-level tz.
Fields§
§at: String"HH:MM" (24h) for a repeating trigger, or
"YYYY-MM-DD HH:MM" (hyphen / slash / T separators all
accepted) for a one-shot. Parsed lazily —
Schedule::validate rejects garbage at create time.
days: Vec<String>Day-of-week filter for a time-of-day at: ["mon-fri"],
["mon","wed","fri"], … (passed verbatim to the cron DOW
field, so ranges and names both work). An nth-weekday
["tue#2"] fires only on the 2nd Tuesday of each month
(“Patch Tuesday”); the ordinal is 1..5. A last-weekday
["friL"] fires only on the last Friday of each month (handy
for monthly maintenance). Empty = every day. Must be empty
when at carries a date (the date already pins the day).
Implementations§
Source§impl CalendarSpec
impl CalendarSpec
Sourcepub fn oneshot_instant(&self, tz: ScheduleTz) -> Option<DateTime<Utc>>
pub fn oneshot_instant(&self, tz: ScheduleTz) -> Option<DateTime<Utc>>
For a one-shot (at carries a date), the absolute instant it
fires in tz. None for a repeating calendar. Used to warn
about a one-shot whose date is already in the past (it would
never fire).
Trait Implementations§
Source§impl Clone for CalendarSpec
impl Clone for CalendarSpec
Source§fn clone(&self) -> CalendarSpec
fn clone(&self) -> CalendarSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CalendarSpec
impl Debug for CalendarSpec
Source§impl<'de> Deserialize<'de> for CalendarSpec
impl<'de> Deserialize<'de> for CalendarSpec
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>,
impl Eq for CalendarSpec
Source§impl JsonSchema for CalendarSpec
impl JsonSchema for CalendarSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for CalendarSpec
impl PartialEq for CalendarSpec
Source§fn eq(&self, other: &CalendarSpec) -> bool
fn eq(&self, other: &CalendarSpec) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CalendarSpec
impl Serialize for CalendarSpec
impl StructuralPartialEq for CalendarSpec
Auto Trait Implementations§
impl Freeze for CalendarSpec
impl RefUnwindSafe for CalendarSpec
impl Send for CalendarSpec
impl Sync for CalendarSpec
impl Unpin for CalendarSpec
impl UnsafeUnpin for CalendarSpec
impl UnwindSafe for CalendarSpec
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.