pub struct Deadline {
pub case: CaseId,
pub name: String,
pub resolved_at: Timestamp,
pub calendar_digest: Digest,
pub warn_at: Option<Timestamp>,
pub state: DeadlineState,
pub acknowledged: Option<BreachNote>,
}Expand description
A registered obligation with a resolved instant.
§The instant is a fact, not a formula
resolved_at is stored, and never recomputed. Calendars change — a
corrected holiday table, a new regulatory notice — and recomputing on replay
would silently move a legally binding instant under an audit. The
calendar_digest records which calendar version produced it, so a shifted
rule is visible rather than retroactive.
Fields§
§case: CaseId§name: StringUnique within the case.
resolved_at: Timestamp§calendar_digest: DigestWhich calendar version produced resolved_at.
warn_at: Option<Timestamp>§state: DeadlineState§acknowledged: Option<BreachNote>Who accounted for the breach, once somebody has.
Only ever set on a Breached obligation, and
it is what takes the breach off the obligation listing — see
CaseStore::acknowledge_breach. None on every other state, because
there is nothing to account for.
Implementations§
Source§impl Deadline
impl Deadline
pub fn is_due(&self, now: Timestamp) -> bool
Sourcepub const fn is_unaccounted(&self) -> bool
pub const fn is_unaccounted(&self) -> bool
A breach nobody has accounted for yet.
The decoded form of DeadlineState::is_unaccounted, which carries the
rule. What a caller holding a whole obligation asks — including the
embedded backend’s own listing, which reads an index and then holds the
row it decoded to this, because an index is a hint and the row is the
record.
pub fn needs_warning(&self, now: Timestamp) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Deadline
impl<'de> Deserialize<'de> for Deadline
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>,
Source§impl JsonSchema for Deadline
impl JsonSchema for Deadline
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 Deadline
Auto Trait Implementations§
impl Freeze for Deadline
impl RefUnwindSafe for Deadline
impl Send for Deadline
impl Sync for Deadline
impl Unpin for Deadline
impl UnsafeUnpin for Deadline
impl UnwindSafe for Deadline
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<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