Enum icalendar::CalendarDateTime
source · [−]pub enum CalendarDateTime {
Floating(NaiveDateTime),
Utc(DateTime<Utc>),
}
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.
Trait Implementations
sourceimpl Clone for CalendarDateTime
impl Clone for CalendarDateTime
sourcefn clone(&self) -> CalendarDateTime
fn clone(&self) -> CalendarDateTime
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CalendarDateTime
impl Debug for CalendarDateTime
sourceimpl Display for CalendarDateTime
impl Display for CalendarDateTime
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
.
sourcefn from(dt: NaiveDateTime) -> Self
fn from(dt: NaiveDateTime) -> Self
Converts to this type from the input type.
sourceimpl PartialEq<CalendarDateTime> for CalendarDateTime
impl PartialEq<CalendarDateTime> for CalendarDateTime
sourcefn eq(&self, other: &CalendarDateTime) -> bool
fn eq(&self, other: &CalendarDateTime) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CalendarDateTime) -> bool
fn ne(&self, other: &CalendarDateTime) -> bool
This method tests for !=
.
impl Copy for CalendarDateTime
impl Eq for CalendarDateTime
impl StructuralEq for CalendarDateTime
impl StructuralPartialEq for CalendarDateTime
Auto Trait Implementations
impl RefUnwindSafe for CalendarDateTime
impl Send for CalendarDateTime
impl Sync for CalendarDateTime
impl Unpin for CalendarDateTime
impl UnwindSafe for CalendarDateTime
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more