The Builder type is used to construct Uuids when you need to mutate individual fields (like version or variant) during construction. Since Uuid is a Copy type, it does not provide in-place mutation methods; instead, these methods are implemented on the Builder. The Builder also provides a lower-level API that allows constructing any UUID version without requiring specific crate features or additional dependencies.
# use uuid::{Builder, Version, Variant};
# let rng = || [70, 235, 208, 238, 14, 109, 67, 201, 185, 13, 204, 195, 90, 145, 63, 62];
let random_bytes = rng();
let uuid = Builder::from_random_bytes(random_bytes).into_uuid();
assert_eq!(Some(Version::Random), uuid.get_version());
assert_eq!(Variant::RFC4122, uuid.get_variant());