#[non_exhaustive]pub enum MetarTime {
DateTime(UtcDateTime),
DayTime(UtcDayTime),
Time(UtcTime),
}Expand description
METAR date and time combinations.
JSON representation is adjacently tagged and in lowercase snake case. Example:
{
"value_type": "date_time",
"value": "2023-12-27T08:30:00Z"
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl MetarTime
impl MetarTime
Sourcepub fn to_date_time(&self, anchor_time: NaiveDateTime) -> MetarTime
pub fn to_date_time(&self, anchor_time: NaiveDateTime) -> MetarTime
Converts any MetarTime into MetarTime::DateTime.
Using anchor_time, any MetarTime will be converted to a MetarTime::DateTime that is nearest
to the specified anchor_time while preserving all the datetime information in the input MetarTime.
This conversion correctly handles months with different number of days and also leap years.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MetarTime
impl<'de> Deserialize<'de> for MetarTime
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 Copy for MetarTime
impl Eq for MetarTime
impl StructuralPartialEq for MetarTime
Auto Trait Implementations§
impl Freeze for MetarTime
impl RefUnwindSafe for MetarTime
impl Send for MetarTime
impl Sync for MetarTime
impl Unpin for MetarTime
impl UnwindSafe for MetarTime
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