pub struct DeadlineSpec {
pub kind: String,
pub params: Value,
}Expand description
A domain-specific deadline description.
Deliberately opaque: “5 working days at 17:00 Europe/Berlin, excluding
public holidays observed in any federal state” is domain knowledge and does
not belong in a domain-agnostic engine. The engine carries the spec to a
Calendar and enforces whatever instant comes back.
Fields§
§kind: StringWhich resolution rule to apply, e.g. "hours", "working-days".
params: ValueParameters for that rule.
Implementations§
Source§impl DeadlineSpec
impl DeadlineSpec
pub fn new(kind: impl Into<String>, params: Value) -> Self
Sourcepub fn minutes(n: u32) -> Self
pub fn minutes(n: u32) -> Self
A plain wall-clock offset, understood by the built-in calendar.
One constructor per rule WallClock accepts, and the set is closed for
a reason: a rule with no canonical spelling is where "minutes",
"minute" and "mins" diverge between an application and the calendar
adapter meant to resolve them — and a calendar that does not recognise a
kind refuses it, so the drift surfaces as a failed obligation rather
than a wrong one. minutes was the rule that had this hole:
WallClock resolved it and nothing here spelled it.
Trait Implementations§
Source§impl Clone for DeadlineSpec
impl Clone for DeadlineSpec
Source§fn clone(&self) -> DeadlineSpec
fn clone(&self) -> DeadlineSpec
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 DeadlineSpec
impl Debug for DeadlineSpec
Source§impl<'de> Deserialize<'de> for DeadlineSpec
impl<'de> Deserialize<'de> for DeadlineSpec
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 DeadlineSpec
Source§impl PartialEq for DeadlineSpec
impl PartialEq for DeadlineSpec
Source§impl Serialize for DeadlineSpec
impl Serialize for DeadlineSpec
impl StructuralPartialEq for DeadlineSpec
Auto Trait Implementations§
impl Freeze for DeadlineSpec
impl RefUnwindSafe for DeadlineSpec
impl Send for DeadlineSpec
impl Sync for DeadlineSpec
impl Unpin for DeadlineSpec
impl UnsafeUnpin for DeadlineSpec
impl UnwindSafe for DeadlineSpec
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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