mirror of
https://github.com/uuid-rs/uuid.git
synced 2025-10-02 07:20:40 +00:00
Merge pull request #711 from John-Toohey/bytemuck
Added `bytemuck` support
This commit is contained in:
commit
b8ebdee9b0
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -2,7 +2,7 @@ name: Continuous integration
|
||||
|
||||
env:
|
||||
VERSION_FEATURES: "v1 v3 v4 v5 v6 v7 v8"
|
||||
DEP_FEATURES: "slog serde arbitrary borsh zerocopy"
|
||||
DEP_FEATURES: "slog serde arbitrary borsh zerocopy bytemuck"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
@ -71,6 +71,13 @@ fast-rng = ["rng", "rand"]
|
||||
sha1 = ["sha1_smol"]
|
||||
md5 = ["md-5"]
|
||||
|
||||
|
||||
# Public: Used in trait impls on `Uuid`
|
||||
[dependencies.bytemuck]
|
||||
version = "1.14.0"
|
||||
optional = true
|
||||
features = ["derive"]
|
||||
|
||||
# Public: Used in trait impls on `Uuid`
|
||||
[dependencies.serde]
|
||||
default-features = false
|
||||
|
@ -108,6 +108,7 @@
|
||||
//! * `fast-rng` - uses a faster algorithm for generating random UUIDs.
|
||||
//! This feature requires more dependencies to compile, but is just as suitable for
|
||||
//! UUIDs as the default algorithm.
|
||||
//! * `bytemuck` - adds a `Pod` trait implementation to `Uuid` for byte manipulation
|
||||
//!
|
||||
//! # Unstable features
|
||||
//!
|
||||
@ -447,6 +448,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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user