pub struct ValidTime {
pub start: Option<DateTime<Utc>>,
pub end: Option<DateTime<Utc>>,
pub valid_time_confidence: f32,
pub start_granularity: Option<DateGranularity>,
pub end_granularity: Option<DateGranularity>,
}Expand description
Valid-time interval — fallible and host-extracted (confidence-tagged). When start/end are None, belief ordering falls back to TransactionTime.
Fields§
§start: Option<DateTime<Utc>>Start of the valid-time window (None = unknown / open-ended).
end: Option<DateTime<Utc>>End of the valid-time window (None = unknown / open-ended).
valid_time_confidence: f32Confidence in the valid-time extraction itself (mirrors Confidence.valid_time_confidence).
start_granularity: Option<DateGranularity>Optional precision hint for the start field when it was derived from a partial date
string (e.g. "2024" → Year, "2024-05" → Month). None means the start was
either absent or already a full instant.
Additive field: old serialised ValidTime values without this key deserialise to None.
end_granularity: Option<DateGranularity>Optional precision hint for the end field when it was derived from a partial date string.
None means the end was either absent (open-ended) or already a full instant.
Additive field: old serialised ValidTime values without this key deserialise to None.
Implementations§
Source§impl ValidTime
impl ValidTime
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Returns true iff both start and end are None (unknown valid-time window).
Sourcepub fn is_temporally_incoherent(&self, tx_time: &TransactionTime) -> bool
pub fn is_temporally_incoherent(&self, tx_time: &TransactionTime) -> bool
Returns true iff the interval is temporally incoherent: start > end, or start > tx_time (valid-time boundary must predate or equal the time it was learned).