windows-bindgen 0.41.0

Code gen support for the windows crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

pub fn gen() -> TokenStream {
    quote! {
        impl ::core::convert::From<::core::time::Duration> for TimeSpan {
            fn from(value: ::core::time::Duration) -> Self {
                Self {
                    Duration: (value.as_nanos() / 100) as i64,
                }
            }
        }
        impl ::core::convert::From<TimeSpan> for ::core::time::Duration {
            fn from(value: TimeSpan) -> Self {
                ::core::time::Duration::from_nanos((value.Duration * 100) as u64)
            }
        }
    }
}