mirror of
https://github.com/mbilker/vgpu_unlock-rs.git
synced 2026-01-17 20:07:00 +01:00
nvidia: refactor everything out of the main class and use official naming and structs where possible
This commit is contained in:
25
src/uuid.rs
Normal file
25
src/uuid.rs
Normal file
@@ -0,0 +1,25 @@
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
#[repr(C)]
|
||||
pub struct Uuid(pub u32, pub u16, pub u16, pub [u8; 8]);
|
||||
|
||||
impl fmt::Display for Uuid {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"{:08x}-{:04x}-{:04x}-{:02x}{:02x}-{:02x}{:02x}{:02x}{:02x}{:02x}{:02x}",
|
||||
self.0,
|
||||
self.1,
|
||||
self.2,
|
||||
self.3[0],
|
||||
self.3[1],
|
||||
self.3[2],
|
||||
self.3[3],
|
||||
self.3[4],
|
||||
self.3[5],
|
||||
self.3[6],
|
||||
self.3[7]
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user