pub enum DateTimeOrDate<M = TimeFormat> {
DateTime(DateTime<M>),
Date(Date),
}Expand description
Either a full datetime or a date-only value.
Variants§
Implementations§
Source§impl<M> DateTimeOrDate<M>
impl<M> DateTimeOrDate<M>
Sourcepub fn is_date_time(&self) -> bool
pub fn is_date_time(&self) -> bool
Returns true if this is a full datetime value.
Sourcepub fn map_marker<N>(self, f: impl FnOnce(M) -> N) -> DateTimeOrDate<N>
pub fn map_marker<N>(self, f: impl FnOnce(M) -> N) -> DateTimeOrDate<N>
Converts the marker type of the inner datetime.
Trait Implementations§
Source§impl<M> Clone for DateTimeOrDate<M>where
M: Clone,
impl<M> Clone for DateTimeOrDate<M>where
M: Clone,
Source§fn clone(&self) -> DateTimeOrDate<M>
fn clone(&self) -> DateTimeOrDate<M>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<M> Copy for DateTimeOrDate<M>where
M: Copy,
Source§impl<M> Debug for DateTimeOrDate<M>where
M: Debug,
impl<M> Debug for DateTimeOrDate<M>where
M: Debug,
impl<M> Eq for DateTimeOrDate<M>where
M: Eq,
Source§impl<M> PartialEq for DateTimeOrDate<M>where
M: PartialEq,
impl<M> PartialEq for DateTimeOrDate<M>where
M: PartialEq,
impl<M> StructuralPartialEq for DateTimeOrDate<M>where
M: PartialEq,
Source§impl WriteIcal for DateTimeOrDate<Utc>
impl WriteIcal for DateTimeOrDate<Utc>
Source§fn write_ical(&self, w: &mut dyn Write) -> Result
fn write_ical(&self, w: &mut dyn Write) -> Result
Writes this value to the given writer in iCalendar wire format.
Source§fn to_ical_string(&self) -> String
fn to_ical_string(&self) -> String
Convenience method that serializes to a
String.Source§impl WriteIcal for DateTimeOrDate<TimeFormat>
impl WriteIcal for DateTimeOrDate<TimeFormat>
Source§fn write_ical(&self, w: &mut dyn Write) -> Result
fn write_ical(&self, w: &mut dyn Write) -> Result
Writes this value to the given writer in iCalendar wire format.
Source§fn to_ical_string(&self) -> String
fn to_ical_string(&self) -> String
Convenience method that serializes to a
String.Auto Trait Implementations§
impl<M> Freeze for DateTimeOrDate<M>
impl<M> RefUnwindSafe for DateTimeOrDate<M>where
DateTime<M>: RefUnwindSafe,
impl<M> Send for DateTimeOrDate<M>
impl<M> Sync for DateTimeOrDate<M>
impl<M> Unpin for DateTimeOrDate<M>
impl<M> UnsafeUnpin for DateTimeOrDate<M>where
DateTime<M>: UnsafeUnpin,
impl<M> UnwindSafe for DateTimeOrDate<M>where
DateTime<M>: UnwindSafe,
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