Struct elastic_types::date::prelude::FormattableDateValue
[−]
pub struct FormattableDateValue<F>(_, _);
A date value paired with a format.
FormattableDateValue<F>
bundles a DateValue
with a specific format and is used to ensure the formats of mappable date types aren't accidentally changed.
Like DateValue
, this type is used for binding generics in methods that accept date values but it requires the input type uses a specific format.
You probably don't need to use it directly except to ensure date formats aren't silently changed.
Methods
impl<F> FormattableDateValue<F> where
F: DateFormat,
[src]
F: DateFormat,
fn format<'a>(&'a self) -> FormattedDate<'a>
Format the wrapped date value using the generic format.
fn parse(date: &str) -> Result<Self, ParseError>
Parse a date value using the generic format.
Trait Implementations
impl<F: Debug> Debug for FormattableDateValue<F>
[src]
impl<F: Clone> Clone for FormattableDateValue<F>
[src]
fn clone(&self) -> FormattableDateValue<F>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<F: PartialEq> PartialEq for FormattableDateValue<F>
[src]
fn eq(&self, __arg_0: &FormattableDateValue<F>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &FormattableDateValue<F>) -> bool
This method tests for !=
.
impl<F> From<DateValue> for FormattableDateValue<F>
[src]
impl<F> Borrow<ChronoDateTime> for FormattableDateValue<F>
[src]
fn borrow(&self) -> &ChronoDateTime
Immutably borrows from an owned value. Read more
impl<F> PartialEq<ChronoDateTime> for FormattableDateValue<F>
[src]
fn eq(&self, other: &ChronoDateTime) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ChronoDateTime) -> bool
This method tests for !=
.
impl From<ChronoDateTime> for FormattableDateValue<ChronoFormat>
[src]
fn from(date: ChronoDateTime) -> Self
Performs the conversion.
impl<M> From<Date<M>> for FormattableDateValue<M::Format> where
M: DateMapping,
[src]
M: DateMapping,