pub trait WordExt: Copy {
// Required method
fn value(self) -> u16;
// Provided methods
fn lobyte(self) -> u8 { ... }
fn hibyte(self) -> u8 { ... }
fn split(self) -> (u8, u8) { ... }
}Expand description
This trait provides the freestanding functions from minwindef directly on WORDs (u16).
When using new-types that wrap a WORD, 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::WordExt; // or: windows_ext::minwindef::ext::DWordExt;
assert_eq!(0x12_34u16.hibyte(), 0x12);
assert_eq!(0x12_34u16.lobyte(), 0x34);Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.