Enum icalendar::CalendarDateTime
source · pub enum CalendarDateTime {
Floating(NaiveDateTime),
Utc(DateTime<Utc>),
WithTimezone {
date_time: NaiveDateTime,
tzid: String,
},
}Expand description
Representation of various forms of DATE-TIME per
RFC 5545, Section 3.3.5
Conversions from chrono types are provided in form of From implementations, see documentation of individual variants.
In addition to readily implemented FORM #1 and FORM #2, the RFC also specifies
FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE. This variant is not yet implemented.
Adding it will require adding support for VTIMEZONE and referencing it using TZID.
Variants§
Floating(NaiveDateTime)
FORM #1: DATE WITH LOCAL TIME: floating, follows current time-zone of the attendee.
Conversion from chrono::NaiveDateTime results in this variant.
Utc(DateTime<Utc>)
FORM #2: DATE WITH UTC TIME: rendered with Z suffix character.
Conversion from chrono::DateTime<Utc> results in this variant. Use
date_time.with_timezone(&Utc) to convert date_time from arbitrary time zone to UTC.
WithTimezone
Fields
date_time: NaiveDateTimeThe date and time in the given time zone.
FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE: refers to a time zone definition.
Trait Implementations§
source§impl Clone for CalendarDateTime
impl Clone for CalendarDateTime
source§fn clone(&self) -> CalendarDateTime
fn clone(&self) -> CalendarDateTime
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for CalendarDateTime
impl Debug for CalendarDateTime
source§impl From<CalendarDateTime> for DatePerhapsTime
impl From<CalendarDateTime> for DatePerhapsTime
source§fn from(dt: CalendarDateTime) -> Self
fn from(dt: CalendarDateTime) -> Self
source§impl From<DateTime<Utc>> for CalendarDateTime
impl From<DateTime<Utc>> for CalendarDateTime
Converts from time zone-aware UTC date-time to CalendarDateTime::Utc.
source§impl From<NaiveDateTime> for CalendarDateTime
impl From<NaiveDateTime> for CalendarDateTime
Converts from time zone-less date-time to CalendarDateTime::Floating.
source§fn from(dt: NaiveDateTime) -> Self
fn from(dt: NaiveDateTime) -> Self
source§impl FromStr for CalendarDateTime
impl FromStr for CalendarDateTime
source§impl PartialEq<CalendarDateTime> for CalendarDateTime
impl PartialEq<CalendarDateTime> for CalendarDateTime
source§fn eq(&self, other: &CalendarDateTime) -> bool
fn eq(&self, other: &CalendarDateTime) -> bool
self and other values to be equal, and is used
by ==.