Added bytemuck support

This commit is contained in:
John Toohey 2023-10-15 12:12:14 +01:00
parent 50f70278de
commit 646dc1a82e
No known key found for this signature in database
GPG Key ID: A7F660048EACBDA6
2 changed files with 7 additions and 0 deletions

View File

@ -71,6 +71,9 @@ fast-rng = ["rng", "rand"]
sha1 = ["sha1_smol"]
md5 = ["md-5"]
[dependencies]
bytemuck = { version = "1.14.0", optional = true, features = ["derive"] }
# Public: Used in trait impls on `Uuid`
[dependencies.serde]
default-features = false

View File

@ -447,6 +447,10 @@ pub enum Variant {
derive(borsh::BorshDeserialize, borsh::BorshSerialize)
)]
#[repr(transparent)]
#[cfg_attr(
feature = "bytemuck",
derive(bytemuck::Zeroable, bytemuck::Pod, bytemuck::TransparentWrapper)
)]
pub struct Uuid(Bytes);
impl Uuid {