pub struct Active {
pub from: Option<String>,
pub until: Option<String>,
}Expand description
Optional validity window for a Schedule (#418 decision G).
Half-open [from, until); either bound may be omitted. Bounds
are YYYY-MM-DD (= that day’s 00:00 in the schedule’s tz) or
full RFC3339 (offset is honored as-is, tz ignored). Kept as
strings so the JSON Schema the SPA editor consumes stays two
plain string fields, mirroring jitter / starting_deadline.
#418 Phase 2: bounds are evaluated in the schedule’s top-level
tz (was UTC-only in Phase 1) so tz: local makes both the
calendar at AND the active window local — one consistent
timezone per schedule.
Fields§
§from: Option<String>Dormant before this instant.
until: Option<String>Dormant from this instant on (exclusive).
Implementations§
Source§impl Active
impl Active
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
skip_serializing_if helper — an empty window means “always
active” and is omitted from the wire format entirely.
Sourcepub fn parse_bound(s: &str, tz: ScheduleTz) -> Result<DateTime<Utc>, String>
pub fn parse_bound(s: &str, tz: ScheduleTz) -> Result<DateTime<Utc>, String>
Parse one bound: RFC3339 first (offset honored, tz
ignored), then bare YYYY-MM-DD (00:00 in tz).
Sourcepub fn contains(&self, now: DateTime<Utc>, tz: ScheduleTz) -> bool
pub fn contains(&self, now: DateTime<Utc>, tz: ScheduleTz) -> bool
Is now inside the window? Unparseable bounds are treated
as absent here (fail-open) — Schedule::validate is the
place that rejects them loudly; this runs on every tick and
must never panic on a stale KV blob.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Active
impl<'de> Deserialize<'de> for Active
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 Active
Source§impl JsonSchema for Active
impl JsonSchema for Active
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 Active
Auto Trait Implementations§
impl Freeze for Active
impl RefUnwindSafe for Active
impl Send for Active
impl Sync for Active
impl Unpin for Active
impl UnsafeUnpin for Active
impl UnwindSafe for Active
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.