Skip to main content

UuidExt

Trait UuidExt 

Source
pub trait UuidExt {
    // Required methods
    fn to_int_array(&self) -> [i32; 4];
    fn from_int_array(arr: &[i32]) -> Option<Uuid>;
}
Expand description

Extension trait for UUID to support Minecraft’s NBT int array format.

Required Methods§

Source

fn to_int_array(&self) -> [i32; 4]

Converts a UUID to an int array for NBT storage (vanilla format).

The UUID is split into 4 big-endian i32 values, matching vanilla’s UUIDUtil.uuidToIntArray().

Source

fn from_int_array(arr: &[i32]) -> Option<Uuid>

Parses a UUID from an int array (vanilla NBT format).

Returns None if the slice doesn’t have exactly 4 elements. Matches vanilla’s UUIDUtil.uuidFromIntArray().

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl UuidExt for Uuid

Implementors§