Trait GuidExt

pub trait GuidExt {
    // Required methods
    fn format_simple(&self) -> String;
    fn format_hyphenated(&self) -> String;
    unsafe fn misinterpret(&self) -> [u8; 16];
}
Expand description

Extensions for GUID.

Required Methods§

fn format_simple(&self) -> String

Formats the GUID as a simple hex string.

fn format_hyphenated(&self) -> String

Formats the GUID as a hyphenated hex string.

unsafe fn misinterpret(&self) -> [u8; 16]

Returns the contained GUID misinterpreted as raw bytes.

Some GW2 community projects misinterpret the memory layout of the GUID as bytes rather than a Windows GUID. This is helpful when comparing or interfacing with such projects.

§Safety

The returned bytes represent the memory of the underlying Windows GUID struct. They do not represent the actual GUID. Constructing a GUID with them will result in a different GUID than the original.

To get the correct bytes you can convert the GUID to a u128 and then to bytes.

Implementors§

§

impl GuidExt for GUID