ireko/src/guid.rs

35 lines
690 B
Rust
Raw Normal View History

use binrw::binrw;
use std::fmt;
// See https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Core/Misc/FGuid
#[binrw]
pub struct Guid {
pub a: u32,
pub b: u32,
pub c: u32,
pub d: u32,
}
impl crate::structs::PropertyBase for Guid {
fn type_name() -> &'static str {
2025-03-02 14:13:41 -05:00
"StructProperty"
}
fn struct_name() -> Option<&'static str> {
2025-03-02 14:13:41 -05:00
Some("Guid")
}
fn size_in_bytes(&self) -> u32 {
16
}
}
impl fmt::Debug for Guid {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&format!(
"{:02X}{:02X}{:02X}{:02X}",
self.a, self.b, self.c, self.d
))
}
}