1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
// Google protobuf Timestamp and Duration types reimplemented because their comments are turned // into invalid documentation texts and doctest chokes on them. See https://github.com/danburkert/prost/issues/374 // Prost does not seem to have a way yet to remove documentations defined in protobuf files. // These structs are defined in gogoproto v1.3.1 at https://github.com/gogo/protobuf/tree/v1.3.1/protobuf/google/protobuf /// A Timestamp represents a point in time independent of any time zone or local /// calendar, encoded as a count of seconds and fractions of seconds at /// nanosecond resolution. The count is relative to an epoch at UTC midnight on /// January 1, 1970, in the proleptic Gregorian calendar which extends the /// Gregorian calendar backwards to year one. /// /// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap /// second table is needed for interpretation, using a [24-hour linear /// smear](https://developers.google.com/time/smear). /// /// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By /// restricting to that range, we ensure that we can convert to and from [RFC /// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. #[derive(Clone, PartialEq, ::prost::Message, ::serde::Deserialize, ::serde::Serialize)] #[serde(from = "crate::serializers::timestamp::Rfc3339", into = "crate::serializers::timestamp::Rfc3339")] pub struct Timestamp { /// Represents seconds of UTC time since Unix epoch /// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to /// 9999-12-31T23:59:59Z inclusive. #[prost(int64, tag = "1")] pub seconds: i64, /// Non-negative fractions of a second at nanosecond resolution. Negative /// second values with fractions must still have non-negative nanos values /// that count forward in time. Must be from 0 to 999,999,999 /// inclusive. #[prost(int32, tag = "2")] pub nanos: i32, } /// A Duration represents a signed, fixed-length span of time represented /// as a count of seconds and fractions of seconds at nanosecond /// resolution. It is independent of any calendar and concepts like "day" /// or "month". It is related to Timestamp in that the difference between /// two Timestamp values is a Duration and it can be added or subtracted /// from a Timestamp. Range is approximately +-10,000 years. #[derive(Clone, PartialEq, ::prost::Message, ::serde::Deserialize, ::serde::Serialize)] pub struct Duration { /// Signed seconds of the span of time. Must be from -315,576,000,000 /// to +315,576,000,000 inclusive. Note: these bounds are computed from: /// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years #[prost(int64, tag = "1")] pub seconds: i64, /// Signed fractions of a second at nanosecond resolution of the span /// of time. Durations less than one second are represented with a 0 /// `seconds` field and a positive or negative `nanos` field. For durations /// of one second or more, a non-zero value for the `nanos` field must be /// of the same sign as the `seconds` field. Must be from -999,999,999 /// to +999,999,999 inclusive. #[prost(int32, tag = "2")] pub nanos: i32, }