pub enum DateGranularity {
Year,
Month,
Day,
Instant,
}Expand description
Granularity of a valid-time date that was extracted from a partial date string.
When a host supplies a date like "2024" or "2024-05", the engine normalises it to a
DateTime<Utc> start-of-period but records the original precision here so that callers can
render dates honestly (e.g. display "2024" instead of "2024-01-01T00:00:00Z").
Additive field — existing ValidTime values without this field deserialise with None
(see #[serde(default)] on ValidTime::start_granularity and ValidTime::end_granularity).
Variants§
Year
The date was given as a four-digit year, e.g. "2024".
Month
The date was given as year-month, e.g. "2024-05".
Day
The date was given as a full calendar date, e.g. "2024-05-15".
Instant
The date was given as a full instant (date + time), e.g. an RFC-3339 string.
Trait Implementations§
Source§impl Clone for DateGranularity
impl Clone for DateGranularity
Source§fn clone(&self) -> DateGranularity
fn clone(&self) -> DateGranularity
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DateGranularity
Source§impl Debug for DateGranularity
impl Debug for DateGranularity
Source§impl<'de> Deserialize<'de> for DateGranularity
impl<'de> Deserialize<'de> for DateGranularity
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
impl Eq for DateGranularity
Source§impl PartialEq for DateGranularity
impl PartialEq for DateGranularity
Source§fn eq(&self, other: &DateGranularity) -> bool
fn eq(&self, other: &DateGranularity) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DateGranularity
impl Serialize for DateGranularity
impl StructuralPartialEq for DateGranularity
Auto Trait Implementations§
impl Freeze for DateGranularity
impl RefUnwindSafe for DateGranularity
impl Send for DateGranularity
impl Sync for DateGranularity
impl Unpin for DateGranularity
impl UnsafeUnpin for DateGranularity
impl UnwindSafe for DateGranularity
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