From 2aa4a82499d4becd2284cdb482213d541b8804dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 28 Apr 2024 16:29:10 +0200 Subject: Adding upstream version 86.0.1. Signed-off-by: Daniel Baumann --- third_party/rust/toml/src/datetime.rs | 425 ++++++++ third_party/rust/toml/src/de.rs | 1327 +++++++++++++++++++++++++ third_party/rust/toml/src/lib.rs | 168 ++++ third_party/rust/toml/src/ser.rs | 1714 +++++++++++++++++++++++++++++++++ third_party/rust/toml/src/tokens.rs | 620 ++++++++++++ third_party/rust/toml/src/value.rs | 946 ++++++++++++++++++ 6 files changed, 5200 insertions(+) create mode 100644 third_party/rust/toml/src/datetime.rs create mode 100644 third_party/rust/toml/src/de.rs create mode 100644 third_party/rust/toml/src/lib.rs create mode 100644 third_party/rust/toml/src/ser.rs create mode 100644 third_party/rust/toml/src/tokens.rs create mode 100644 third_party/rust/toml/src/value.rs (limited to 'third_party/rust/toml/src') diff --git a/third_party/rust/toml/src/datetime.rs b/third_party/rust/toml/src/datetime.rs new file mode 100644 index 0000000000..83b5c0bb9c --- /dev/null +++ b/third_party/rust/toml/src/datetime.rs @@ -0,0 +1,425 @@ +use std::fmt; +use std::str::{self, FromStr}; +use std::error; + +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