#windows #com #win32

filetime_win

Windows FILETIME and SYSTEMTIME string and binary serialization

4 releases

Uses old Rust 2015

0.2.0 Dec 17, 2020
0.1.0 Mar 21, 2019
0.1.0-alpha2 Mar 5, 2019
0.1.0-alpha1 Mar 2, 2019

#163 in Windows APIs

Download history 300/week @ 2023-01-31 234/week @ 2023-02-07 289/week @ 2023-02-14 300/week @ 2023-02-21 260/week @ 2023-02-28 310/week @ 2023-03-07 328/week @ 2023-03-14 280/week @ 2023-03-21 300/week @ 2023-03-28 247/week @ 2023-04-04 282/week @ 2023-04-11 296/week @ 2023-04-18 247/week @ 2023-04-25 329/week @ 2023-05-02 315/week @ 2023-05-09 292/week @ 2023-05-16

1,227 downloads per month

MIT/Apache

10KB
179 lines

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

~31–255KB