Skip to content

Commit

Permalink
Added bytemuck support
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Toohey committed Oct 15, 2023
1 parent 50f7027 commit 646dc1a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 646dc1a

Please sign in to comment.