QWordExt

Trait QWordExt 

Source
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));

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.

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§