pub enum DateFormat {
Rfc2822,
LongForm,
IsoDate,
IsoDateTime,
}Expand description
The input format that parse_flexible_date matched.
Callers that must preserve their current output byte-for-byte (e.g. the RSS plugin passes RFC 2822 strings through verbatim, wrong weekday and all) can branch on this instead of re-formatting.
§Examples
use ssg::dates::{parse_flexible_date, DateFormat};
let dt = parse_flexible_date("2026-07-01").unwrap();
assert_eq!(dt.format, DateFormat::IsoDate);
let dt = parse_flexible_date("July 1, 2026").unwrap();
assert_eq!(dt.format, DateFormat::LongForm);Variants§
Rfc2822
RFC 2822, e.g. Wed, 01 Jul 2026 07:07:07 +0000.
LongForm
Long form, e.g. July 1, 2026 or 1 July 2026.
IsoDate
ISO 8601 calendar date, e.g. 2026-07-01.
IsoDateTime
ISO 8601 datetime, e.g. 2026-07-01T07:07:07Z.
Trait Implementations§
Source§impl Clone for DateFormat
impl Clone for DateFormat
Source§fn clone(&self) -> DateFormat
fn clone(&self) -> DateFormat
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 Copy for DateFormat
Source§impl Debug for DateFormat
impl Debug for DateFormat
impl Eq for DateFormat
Source§impl Hash for DateFormat
impl Hash for DateFormat
Source§impl PartialEq for DateFormat
impl PartialEq for DateFormat
Source§fn eq(&self, other: &DateFormat) -> bool
fn eq(&self, other: &DateFormat) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DateFormat
Auto Trait Implementations§
impl Freeze for DateFormat
impl RefUnwindSafe for DateFormat
impl Send for DateFormat
impl Sync for DateFormat
impl Unpin for DateFormat
impl UnsafeUnpin for DateFormat
impl UnwindSafe for DateFormat
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more