#[non_exhaustive]pub struct Date(/* private fields */);Expand description
RFC 3339 date-time string with any timezone offset (RFC 8620 §1.4).
Format: YYYY-MM-DDTHH:MM:SS±HH:MM or Z suffix — any valid RFC 3339 offset,
letters uppercase, fractional seconds omitted if zero.
Example: "2014-10-30T14:12:00+08:00".
Distinct from UTCDate, which requires the time-offset to be Z.
Use Date for fields derived from RFC 5322 email headers (e.g. sentAt),
which commonly carry non-UTC offsets.
§Deserialization is NOT validated
Date is #[serde(transparent)] over String. Any string that
deserializes into a String deserializes into a Date, including
values that violate RFC 8620 §1.4 / RFC 3339. The newtype carries
the type-level intent but does NOT enforce it at the wire
boundary. Treat any field of type Option<Date> arriving from a
peer as “RFC 8620 timestamp by convention, not by contract”.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Date
impl<'de> Deserialize<'de> for Date
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Date
impl StructuralPartialEq for Date
Auto Trait Implementations§
impl Forget for Date
impl Freeze for Date
impl Move for Date
impl RefUnwindSafe for Date
impl Send for Date
impl Sync for Date
impl Unpin for Date
impl UnsafeUnpin for Date
impl UnwindSafe for Date
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.