pub struct Freeze {
pub from: Option<String>,
pub until: Option<String>,
pub reason: Option<String>,
pub tz: ScheduleTz,
}Expand description
Fleet-wide change-freeze (#418 Phase 5 — the “メンテナンス窓 /
変更凍結” gap’s global half). Where Constraints::window is a
per-schedule time-of-day gate, a Freeze is a single, fleet-
global “stop all automated change” switch the operator flips
during an incident or a year-end change-freeze. It lives in its
own KV singleton (crate::kv::KEY_FREEZE); when present and
active, both the backend scheduler and every agent’s local
scheduler skip every fire.
Shapes:
{}(no bounds) — frozen indefinitely until the operator clears it (incident “big red button”).{ from, until }— frozen only within[from, until), evaluated intz(planned change-freeze; auto-thaws).
The KV key being absent means “not frozen” — so clearing the
freeze is a KV delete, and is_active only ever runs on a freeze
the operator actually set.
Fields§
§from: Option<String>Frozen from this instant (RFC3339 or bare YYYY-MM-DD in
tz). None ⇒ frozen from the beginning of time.
until: Option<String>Thawed from this instant on, exclusive. None ⇒ frozen with
no scheduled end (manual clear required).
reason: Option<String>Operator-supplied note surfaced on the freeze-skip log and the SPA banner (“year-end change freeze”, “INC-1234”). Advisory.
tz: ScheduleTzTimezone the bare-date bounds are evaluated in (RFC3339 bounds
carry their own offset). Defaults to host-local like a
schedule’s tz.
Implementations§
Source§impl Freeze
impl Freeze
Sourcepub fn is_active(&self, now: DateTime<Utc>) -> bool
pub fn is_active(&self, now: DateTime<Utc>) -> bool
Is the fleet frozen at now? An empty window (from/until
both absent) is frozen unconditionally; otherwise membership of
[from, until) in tz. Half-open like Active::contains,
but fails CLOSED on an unparseable bound — a freeze is a
safety switch, so a corrupt window (only reachable via a
hand-edited KV blob; validate rejects it at set time) must
mean “frozen”, not “fire normally” (coderabbit #472). This is
the one deliberate divergence from active’s fail-OPEN
behaviour, where an unparseable bound dormant-skips a schedule.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Freeze
impl<'de> Deserialize<'de> for Freeze
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 Freeze
Source§impl JsonSchema for Freeze
impl JsonSchema for Freeze
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 Freeze
Auto Trait Implementations§
impl Freeze for Freeze
impl RefUnwindSafe for Freeze
impl Send for Freeze
impl Sync for Freeze
impl Unpin for Freeze
impl UnsafeUnpin for Freeze
impl UnwindSafe for Freeze
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.