From 06f984e182b7924dd25195c5c2f5a4162cafdd6e Mon Sep 17 00:00:00 2001 From: beau trepp Date: Sat, 5 Dec 2020 11:59:10 +0800 Subject: [PATCH] Adds a u64 constructor for wintime This allows you to easily create it if you have obtained it from a different source --- src/timestamp.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/timestamp.rs b/src/timestamp.rs index f91cb9d..c7f599f 100644 --- a/src/timestamp.rs +++ b/src/timestamp.rs @@ -28,6 +28,10 @@ impl WinTimestamp { Self::from_reader(&mut Cursor::new(buffer)) } + pub fn from_u64(value: u64) -> Self { + WinTimestamp(value) + } + #[inline] pub fn from_reader(reader: &mut R) -> Result { let win_timestamp = WinTimestamp(reader.read_u64::()?);