Struct Date
pub struct Date { pub year: u16, pub month: u8, pub day: u8 }
A parsed TOML date value
May be part of a Datetime. Alone, Date corresponds to a Local Date.
From the TOML v1.0.0 spec:
If you include only the date portion of an RFC 3339 formatted date-time, it will represent that entire day without any relation to an offset or timezone.
ld1 = 1979-05-27
Fields
year: u16Year: four digits
month: u8Month: 1 to 12
day: u8Day: 1 to {28, 29, 30, 31} (based on month/year)
Trait Implementations
impl Clone for Date
fn clone(&self) -> Self
impl Copy for Date
impl Debug for Date
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Display for Date
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Date
impl Ord for Date
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for Date
fn eq(&self, other: &Self) -> bool
impl PartialOrd for Date
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
impl Serialize for Date
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer,
impl StructuralPartialEq for Date
impl<'de> Deserialize<'de> for Date
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'de>,
Auto Trait Implementations
impl Freeze 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
impl<T> Any for Date
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Date
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Date
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Date
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> DeserializeOwned for Date
where
T: for<'de> Deserialize<'de>,
impl<T> From<T> for Date
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Date
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> ToString for Date
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for Date
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for Date
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Date
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>