diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:41:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-04 12:41:41 +0000 |
commit | 10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 (patch) | |
tree | bdffd5d80c26cf4a7a518281a204be1ace85b4c1 /vendor/gix-date/src/lib.rs | |
parent | Releasing progress-linux version 1.70.0+dfsg1-9~progress7.99u1. (diff) | |
download | rustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.tar.xz rustc-10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87.zip |
Merging upstream version 1.70.0+dfsg2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-date/src/lib.rs')
-rw-r--r-- | vendor/gix-date/src/lib.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/vendor/gix-date/src/lib.rs b/vendor/gix-date/src/lib.rs new file mode 100644 index 000000000..4a821ffb6 --- /dev/null +++ b/vendor/gix-date/src/lib.rs @@ -0,0 +1,30 @@ +//! Date and time parsing similar to what git can do. +//! +//! Note that this is not a general purpose time library. +//! ## Feature Flags +#![cfg_attr( + feature = "document-features", + cfg_attr(doc, doc = ::document_features::document_features!()) +)] +#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))] +#![deny(missing_docs, rust_2018_idioms)] +#![forbid(unsafe_code)] + +/// +pub mod time; + +/// +pub mod parse; +pub use parse::function::parse; + +/// A timestamp with timezone. +#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)] +#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))] +pub struct Time { + /// time in seconds since epoch. + pub seconds_since_unix_epoch: u32, + /// time offset in seconds, may be negative to match the `sign` field. + pub offset_in_seconds: i32, + /// the sign of `offset`, used to encode `-0000` which would otherwise loose sign information. + pub sign: time::Sign, +} |