From 2db3a68a1ab8d2259634c9ec03ab62aeca63c44d Mon Sep 17 00:00:00 2001 From: Marc Brinkmann Date: Thu, 9 Feb 2023 17:33:40 +0100 Subject: [PATCH] Backport `Timestamp::MAX` from `dev` --- node/src/types/timestamp.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node/src/types/timestamp.rs b/node/src/types/timestamp.rs index 32de195e3d..69cb3c624a 100644 --- a/node/src/types/timestamp.rs +++ b/node/src/types/timestamp.rs @@ -38,6 +38,9 @@ static TIMESTAMP_EXAMPLE: Lazy = Lazy::new(|| { pub struct Timestamp(u64); impl Timestamp { + /// The maximum value a timestamp can have. + pub const MAX: Timestamp = Timestamp(u64::MAX); + /// Returns the timestamp of the current moment. pub fn now() -> Self { let millis = SystemTime::UNIX_EPOCH.elapsed().unwrap().as_millis() as u64;