Struct elastic::types::date::FormattableDateValue
[−]
[src]
pub struct FormattableDateValue<TFormat>(_, _);
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<TFormat> FormattableDateValue<TFormat> where
TFormat: DateFormat,
[src]
TFormat: DateFormat,
pub fn format(&'a self) -> FormattedDate<'a>
[src]
Format the wrapped date value using the generic format.
pub fn parse(date: &str) -> Result<FormattableDateValue<TFormat>, ParseError>
[src]
Parse a date value using the generic format.
Trait Implementations
impl<TFormat> PartialEq<FormattableDateValue<TFormat>> for DateTime<Utc>
[src]
fn eq(&self, other: &FormattableDateValue<TFormat>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &FormattableDateValue<TFormat>) -> bool
[src]
This method tests for !=
.
impl<TFormat> PartialEq<FormattableDateValue<TFormat>> for FormattableDateValue<TFormat> where
TFormat: PartialEq<TFormat>,
[src]
TFormat: PartialEq<TFormat>,
fn eq(&self, __arg_0: &FormattableDateValue<TFormat>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &FormattableDateValue<TFormat>) -> bool
[src]
This method tests for !=
.
impl<TFormat> PartialEq<DateTime<Utc>> for FormattableDateValue<TFormat>
[src]
fn eq(&self, other: &DateTime<Utc>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &DateTime<Utc>) -> bool
[src]
This method tests for !=
.
impl<TFormat> Clone for FormattableDateValue<TFormat> where
TFormat: Clone,
[src]
TFormat: Clone,
fn clone(&self) -> FormattableDateValue<TFormat>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<TFormat> Borrow<DateTime<Utc>> for FormattableDateValue<TFormat>
[src]
impl<TFormat> From<FormattableDateValue<TFormat>> for DateValue
[src]
fn from(date: FormattableDateValue<TFormat>) -> DateValue
[src]
Performs the conversion.
impl<TMapping> From<FormattableDateValue<<TMapping as DateMapping>::Format>> for Date<TMapping> where
TMapping: DateMapping,
[src]
TMapping: DateMapping,
fn from(
date: FormattableDateValue<<TMapping as DateMapping>::Format>
) -> Date<TMapping>
[src]
date: FormattableDateValue<<TMapping as DateMapping>::Format>
) -> Date<TMapping>
Performs the conversion.
impl<TMapping> From<Date<TMapping>> for FormattableDateValue<<TMapping as DateMapping>::Format> where
TMapping: DateMapping,
[src]
TMapping: DateMapping,
fn from(
date: Date<TMapping>
) -> FormattableDateValue<<TMapping as DateMapping>::Format>
[src]
date: Date<TMapping>
) -> FormattableDateValue<<TMapping as DateMapping>::Format>
Performs the conversion.
impl From<DateTime<Utc>> for FormattableDateValue<ChronoFormat>
[src]
fn from(date: DateTime<Utc>) -> FormattableDateValue<ChronoFormat>
[src]
Performs the conversion.
impl<TFormat> From<DateValue> for FormattableDateValue<TFormat>
[src]
fn from(date: DateValue) -> FormattableDateValue<TFormat>
[src]
Performs the conversion.
impl<TFormat> Debug for FormattableDateValue<TFormat> where
TFormat: Debug,
[src]
TFormat: Debug,
Auto Trait Implementations
impl<TFormat> Send for FormattableDateValue<TFormat> where
TFormat: Send,
TFormat: Send,
impl<TFormat> Sync for FormattableDateValue<TFormat> where
TFormat: Sync,
TFormat: Sync,