pub struct DataFreshness {
pub service: String,
pub last_updated: Option<DateTime<Utc>>,
pub age: Option<Duration>,
pub is_stale: bool,
pub age_display: String,
pub last_weekly_date: Option<NaiveDate>,
pub applied_patch_dates: Vec<NaiveDate>,
pub missing_patch_dates: Vec<NaiveDate>,
}Expand description
Information about the freshness of data for a service.
Fields§
§service: StringRadio service code (e.g., “HA”, “ZA”).
last_updated: Option<DateTime<Utc>>When the data was last updated.
age: Option<Duration>Age of the data.
is_stale: boolWhether the data is considered stale.
age_display: StringAge in human-readable format.
last_weekly_date: Option<NaiveDate>Date of the last applied weekly import.
applied_patch_dates: Vec<NaiveDate>Dates of applied patches since last weekly.
missing_patch_dates: Vec<NaiveDate>Dates of missing patches (days that should have patches but don’t).
Implementations§
Source§impl DataFreshness
impl DataFreshness
Sourcepub fn unknown(service: impl Into<String>) -> Self
pub fn unknown(service: impl Into<String>) -> Self
Create a new DataFreshness with unknown/uninitialized state.
Sourcepub fn from_timestamp(
service: impl Into<String>,
timestamp: Option<&str>,
threshold_days: i64,
) -> Self
pub fn from_timestamp( service: impl Into<String>, timestamp: Option<&str>, threshold_days: i64, ) -> Self
Create DataFreshness from a last_updated timestamp string.
Sourcepub fn needs_weekly_update(&self) -> bool
pub fn needs_weekly_update(&self) -> bool
Check if data needs a weekly update (new weekly available).
Sourcepub fn has_missing_patches(&self) -> bool
pub fn has_missing_patches(&self) -> bool
Check if there are missing daily patches to apply.
Trait Implementations§
Source§impl Clone for DataFreshness
impl Clone for DataFreshness
Source§fn clone(&self) -> DataFreshness
fn clone(&self) -> DataFreshness
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataFreshness
impl Debug for DataFreshness
Source§impl<'de> Deserialize<'de> for DataFreshness
impl<'de> Deserialize<'de> for DataFreshness
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DataFreshness
impl RefUnwindSafe for DataFreshness
impl Send for DataFreshness
impl Sync for DataFreshness
impl Unpin for DataFreshness
impl UnsafeUnpin for DataFreshness
impl UnwindSafe for DataFreshness
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
Mutably borrows from an owned value. Read more