use std::error; use std::fmt; use std::str::{self, FromStr}; use serde::{de, ser}; /// A parsed TOML datetime value /// /// This structure is intended to represent the datetime primitive type that can /// be encoded into TOML documents. This type is a parsed version that contains /// all metadata internally. /// /// Currently this type is intentionally conservative and only supports /// `to_string` as an accessor. Over time though it's intended that it'll grow /// more support! /// /// Note that if you're using `Deserialize` to deserialize a TOML document, you /// can use this as a placeholder for where you're expecting a datetime to be /// specified. /// /// Also note though that while this type implements `Serialize` and /// `Deserialize` it's only recommended to use this type with the TOML format, /// otherwise encoded in other formats it may look a little odd. #[derive(PartialEq, Clone)] pub struct Datetime { date: Option, time: Option