pub trait QWordExt: Copy {
    // Required method
    fn value(self) -> u64;

    // Provided methods
    fn lodword(self) -> u32 { ... }
    fn hidword(self) -> u32 { ... }
    fn split(self) -> (u32, u32) { ... }
}
Expand description

This trait provides the freestanding functions from minwindef directly on QWORDs (u64).

When using new-types that wrap a QWORD, 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::QWordExt; // or: windows_ext::minwindef::ext::QWordExt;

assert_eq!(0x1234_5678_9abc_def0u64.hidword(), 0x1234_5678);
assert_eq!(0x1234_5678_9abc_def0u64.lodword(), 0x9abc_def0);

Required Methods§

source

fn value(self) -> u64

Gets the value of the QWORD.

Provided Methods§

source

fn lodword(self) -> u32

Get the low order double word as u32

assert_eq!(0x1234_5678_9abc_def0u64.lodword(), 0x9abc_def0);
source

fn hidword(self) -> u32

Get the high order double word as u32

assert_eq!(0x1234_5678_9abc_def0u64.hidword(), 0x1234_5678);
source

fn split(self) -> (u32, u32)

Split a single quad word into both of its double words (lo, hi)

assert_eq!(0x1234_5678_9abc_def0u64.split(), (0x9abc_def0, 0x1234_5678));

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl QWordExt for u64

source§

fn value(self) -> u64

source§

impl QWordExt for usize

source§

fn value(self) -> u64

QWord for usize, on 32-bit this has normal padding semantics.

Implementors§