pub trait DWordExt: Copy {
// Required method
fn value(self) -> u32;
// Provided methods
fn loword(self) -> u16 { ... }
fn hiword(self) -> u16 { ... }
fn split(self) -> (u16, u16) { ... }
}Expand description
This trait provides the freestanding functions from minwindef directly on DWORDs (u32).
When using new-types that wrap a DWORD, you can implement this trait by implementing the value method.
This trait is included in the convenience wrapper windows_ext::ext.
use windows_ext::ext::DWordExt; // or: windows_ext::minwindef::ext::DWordExt;
assert_eq!(0x1234_5678u32.hiword(), 0x1234);
assert_eq!(0x1234_5678u32.loword(), 0x5678);Required Methods§
Provided Methods§
Sourcefn loword(self) -> u16
fn loword(self) -> u16
Get the low order word as u16
assert_eq!(0x1234_5678u32.loword(), 0x5678);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".