#windows #com #win32

filetime_win

Windows FILETIME and SYSTEMTIME string and binary serialization

3 releases

0.1.0 Mar 21, 2019
0.1.0-alpha2 Mar 5, 2019
0.1.0-alpha1 Mar 2, 2019

#99 in Windows APIs

Download history 11/week @ 2019-12-16 22/week @ 2019-12-23 14/week @ 2019-12-30 49/week @ 2020-01-06 70/week @ 2020-01-13 38/week @ 2020-01-20 15/week @ 2020-01-27 14/week @ 2020-02-03 27/week @ 2020-02-10 50/week @ 2020-02-17 46/week @ 2020-02-24 10/week @ 2020-03-02 34/week @ 2020-03-09 21/week @ 2020-03-16 37/week @ 2020-03-23 29/week @ 2020-03-30

1,364 downloads per month

MIT/Apache

10KB
179 lines


lib.rs:

Windows FILETIME and SYSTEMTIME string and binary serialization

A transparent wrapper is provided for each type, with Display for SystemTimeUTC and Ord and Eq for FileTime.

serde

Use the filetime_serde feature to derive Serialize and Deserialize, you can then derive them for structs containing FILETIME and SYSTEMTIME like so:

# fn main() {}
#
# #[cfg(feature = "filetime_serde")]
# extern crate serde_derive;
# extern crate winapi;
#
# #[cfg(feature = "filetime_serde")]
# mod test {
use filetime_win::{FileTimeSerde, SystemTimeSerde};
use serde_derive::{Deserialize, Serialize};
use winapi::shared::minwindef::FILETIME;
use winapi::um::minwinbase::SYSTEMTIME;

#[derive(Serialize, Deserialize)]
struct SerdeTest {
    #[serde(with = "FileTimeSerde")]
    ft: FILETIME,
    #[serde(with = "SystemTimeSerde")]
    st: SYSTEMTIME,
}
# }

Dependencies

~0.6–1MB
~22K SLoC