pub enum When {
PerPc(PerPolicy),
PerTarget(PerPolicy),
Cron(String),
}Expand description
#418 Phase 1 — the single “when does this fire” axis.
Replaces the old cron + mode + cooldown trio whose
interactions were implicit (cron doubled as both a real
time-of-day trigger and a reconcile poll period; contradictory
combinations silently no-opped). Two shapes:
- reconcile (
per_pc/per_target) — desired-state: “each pc (or one delegate) should have run this withinevery”. The poll period is system-generated (POLL_CRON, every minute) and no longer the operator’s concern. - escape hatch (
cron) — verbatim 6-field cron, fires at the whole target on every tick with no dedup (the oldevery_tick). Temporary: exists only to keep time-of-day schedules (morning-greeting) alive until the Phase 2 calendar form (at/days/tz) lands. New reconcile work must NOT use it.
Variants§
PerPc(PerPolicy)
Fire at each targeted pc: once (kitting — succeed once,
skip forever, forever catching brand-new / re-imaged pcs)
or { every: <humantime> } (patrol — re-arm per pc after
the interval).
PerTarget(PerPolicy)
Fire until any one pc of the target succeeds, then skip
the whole target (once) or re-arm after every. Needs
fleet-wide completion data, so it is backend-only —
runs_on: agent + per_target is rejected by
Schedule::validate.
Cron(String)
Escape hatch: verbatim 6-field cron expression
(sec min hour day month day-of-week), validated with the
same parser tokio-cron-scheduler uses. Every tick fires
the whole target — no dedup, no cooldown.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for When
impl<'de> Deserialize<'de> for When
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 When
Source§impl JsonSchema for When
impl JsonSchema for When
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 moreimpl StructuralPartialEq for When
Auto Trait Implementations§
impl Freeze for When
impl RefUnwindSafe for When
impl Send for When
impl Sync for When
impl Unpin for When
impl UnsafeUnpin for When
impl UnwindSafe for When
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,
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.