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.
§Note
finding this in a calendar is a red flag, datetimes should end in 'Z'
for UTC
or have a TZID
property
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
FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE
: refers to a time zone definition.
Fields
date_time: NaiveDateTime
The date and time in the given time zone.
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 for CalendarDateTime
impl PartialEq 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 ==
.impl Eq for CalendarDateTime
impl StructuralPartialEq for CalendarDateTime
Auto Trait Implementations§
impl Freeze for CalendarDateTime
impl RefUnwindSafe for CalendarDateTime
impl Send for CalendarDateTime
impl Sync for CalendarDateTime
impl Unpin for CalendarDateTime
impl UnwindSafe for CalendarDateTime
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)