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: NaiveDateTime
The date and time in the given time zone.
tzid: String
The ID of the time zone definition in a VTIMEZONE calendar component.
FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE
: refers to a time zone definition.
Trait Implementations
sourceimpl Clone for CalendarDateTime
impl Clone for CalendarDateTime
sourcefn clone(&self) -> CalendarDateTime
fn clone(&self) -> CalendarDateTime
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for CalendarDateTime
impl Debug for CalendarDateTime
sourceimpl From<CalendarDateTime> for DatePerhapsTime
impl From<CalendarDateTime> for DatePerhapsTime
sourcefn from(dt: CalendarDateTime) -> Self
fn from(dt: CalendarDateTime) -> Self
sourceimpl From<DateTime<Utc>> for CalendarDateTime
impl From<DateTime<Utc>> for CalendarDateTime
Converts from time zone-aware UTC date-time to CalendarDateTime::Utc
.
sourceimpl From<NaiveDateTime> for CalendarDateTime
impl From<NaiveDateTime> for CalendarDateTime
Converts from time zone-less date-time to CalendarDateTime::Floating
.