nvidia: refactor everything out of the main class and use official naming and structs where possible

This commit is contained in:
Matt Bilker
2022-12-07 12:16:25 +00:00
parent 17d81e0dbd
commit 72abe3c927
16 changed files with 703 additions and 374 deletions

25
src/uuid.rs Normal file
View 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]
)
}
}