pub struct Uuid {
pub most: u64,
pub least: u64,
}Expand description
A 128-bit universally unique identifier used throughout the Minecraft protocol.
UUIDs identify players, entities, and various protocol objects. They are encoded as two consecutive big-endian 64-bit integers (most significant bits first, then least significant bits), occupying exactly 16 bytes on the wire. The Minecraft protocol uses UUIDs in login packets (player UUID), entity spawn packets, player info, and boss bar management.
The standard display format is 8-4-4-4-12 lowercase hex with dashes
(e.g., 550e8400-e29b-41d4-a716-446655440000).
Fields§
§most: u64Most significant 64 bits of the UUID.
least: u64Least significant 64 bits of the UUID.
Implementations§
Source§impl Uuid
impl Uuid
Sourcepub fn new(most: u64, least: u64) -> Self
pub fn new(most: u64, least: u64) -> Self
Creates a new UUID from its most and least significant 64-bit halves.
Sourcepub fn from_bytes(bytes: [u8; 16]) -> Self
pub fn from_bytes(bytes: [u8; 16]) -> Self
Creates a UUID from a 16-byte array in big-endian order.
The first 8 bytes form the most significant bits, the last 8 form the least significant bits.
Trait Implementations§
Source§impl Debug for Uuid
Debug output uses the same 8-4-4-4-12 hex format as Display for readability.
impl Debug for Uuid
Debug output uses the same 8-4-4-4-12 hex format as Display for readability.
Source§impl Decode for Uuid
Decodes a UUID from two consecutive big-endian u64 values (16 bytes).
impl Decode for Uuid
Decodes a UUID from two consecutive big-endian u64 values (16 bytes).
Reads the most significant 64 bits first, then the least significant 64 bits. Fails if fewer than 16 bytes remain in the buffer.
Source§impl Display for Uuid
Displays the UUID in the standard 8-4-4-4-12 lowercase hex format.
impl Display for Uuid
Displays the UUID in the standard 8-4-4-4-12 lowercase hex format.
This matches the format used by Mojang’s API and the Minecraft client
(e.g., 550e8400-e29b-41d4-a716-446655440000).
Source§impl Encode for Uuid
Encodes a UUID as two consecutive big-endian u64 values (16 bytes total).
impl Encode for Uuid
Encodes a UUID as two consecutive big-endian u64 values (16 bytes total).
The most significant 64 bits are written first, followed by the least significant 64 bits. This matches the Minecraft protocol wire format for all UUID fields.
Source§impl EncodedSize for Uuid
A UUID always occupies exactly 16 bytes on the wire.
impl EncodedSize for Uuid
A UUID always occupies exactly 16 bytes on the wire.
fn encoded_size(&self) -> usize
impl Copy for Uuid
impl Eq for Uuid
impl StructuralPartialEq for Uuid
Auto Trait Implementations§
impl Freeze for Uuid
impl RefUnwindSafe for Uuid
impl Send for Uuid
impl Sync for Uuid
impl Unpin for Uuid
impl UnsafeUnpin for Uuid
impl UnwindSafe for Uuid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.