Skip to content

Releases: uuid-rs/uuid

1.1.1

31 May 23:44
875c2d7
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.1.0...1.1.1

1.1.0

25 May 05:56
99977bb
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.0.0...1.1.0

1.0.0

20 Apr 05:10
9e0dc29
Compare
Choose a tag to compare

This release includes a huge amount of work from a lot of contributors. These notes are duplicated from 1.0.0-alpha.1 since they're relevant for anybody moving from 0.8.2 to 1.0.0.

Changes since the last release

0.8.2...main

Contributions since the last release

@Gaelan @hecsalazarf @Expyron @saiintbrisson @tshepang @Tehnix @Takashiidobe @A248 @clehner

With a special thanks to:

@kinggoesgaming @QnnOkabayashi @Nugine

Highlights

Parsing and formatting methods are now much faster, and work in const too! On my i9 9900K Windows desktop, the difference looks something like this:

Case 1.0.0-alpha.1 0.8.3
parse_invalid_character 40 ns/iter (+/- 0) 39 ns/iter (+/- 1)
parse_invalid_group_len 47 ns/iter (+/- 1) 52 ns/iter (+/- 5)
parse_invalid_groups 58 ns/iter (+/- 1) 58 ns/iter (+/- 0)
parse_invalid_len 57 ns/iter (+/- 2) 6 ns/iter (+/- 0)
parse_nil 16 ns/iter (+/- 0) 50 ns/iter (+/- 4)
parse_nil_hyphenated 17 ns/iter (+/- 0) 59 ns/iter (+/- 2)
parse_random 16 ns/iter (+/- 0) 42 ns/iter (+/- 1)
parse_random_hyphenated 18 ns/iter (+/- 0) 51 ns/iter (+/- 2)
parse_urn 18 ns/iter (+/- 0) 51 ns/iter (+/- 1)

You can go one step further and look at the uuid-simd library for vectorized UUID parsing. It's fast!

You can create UUIDs at compile time using the uuid! macro:

#[macro_use]
extern crate uuid;

use uuid::Uuid;

const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");

Enable the macro-diagnostics crate feature to get better diagnostics from uuid! using a procedural macro.

Breaking changes

Relocation of adapter::compact

This module can now be found in serde::compact. It can be combined with #[serde(with)] to serialize a Uuid using a more compact representation. We originally moved to this representation directly, but discovered it comes with its own drawbacks that aren't suitable for all formats.

Infallible constructors

The following methods have been changed to accept a &[u8; N] instead of a &[u8], making them infallible instead of returning a Result:

  • Uuid::from_fields
  • Uuid::from_fields_le
  • Uuid::new_v1
  • Builder::from_fields
  • Builder::from_fields_le

Infallible get_variant

The Uuid::get_variant method now returns a Variant instead of an Option<Varaint>, because it's not actually possible for it to ever be None.

Uuid::to_timestamp is now Uuid::get_timestamp

The Uuid::to_timestamp method has been renamed to Uuid::get_timestamp to make it more consistent with Uuid::get_version and Uuid::get_variant.

Changes to formatting methods

The following methods that produce formatting adapters have been renamed:

  • Uuid::to_hyphenated -> Uuid::hyphenated
  • Uuid::to_simple -> Uuid::simple
  • Uuid::to_urn -> Uuid::urn

The following types have been removed:

  • HyphenatedRef
  • SimpleRef
  • UrnRef

The following methods have been changed to return a &<AdapterType> instead of an <AtapterType>Ref:

  • Uuid::to_hyphenated_ref -> Uuid::as_hyphenated
  • Uuid::to_simple_ref -> Uuid::as_simple
  • Uuid::to_urn_ref -> Uuid::as_urn

Builder method consistency

The Builder::build method has been renamed to Builder::into_uuid, to complement the <AdapterType>::into_uuid methods. It also gets an equivalent Builder::as_uuid method.

Version and Variant are non-exhaustive

The #[non_exhaustive] attribute has been added to Version and Variant. There are already active proposals for new UUID versions, so these are likely to continue evolving in the future.

Removed winapi support

The Uuid::to_guid and Uuid::from_guid methods have been removed. This was done for two reasons:

  • We need to avoid unstable winapi types in the stable uuid public API.
  • Whether or not GUID fields need to be flipped to convert into a UUID depends on the source of the GUID, so we can't really offer a single pair of methods to convert a GUID into a UUID.

There are some examples in the repository root that demonstrate how to convert GUIDs into UUIDs as a replacement.

Building with --all-features

Now that uuid includes unstable features, if you're building with --all-features (such as in package manager scenarios), you'll also need to pass RUSTFLAGS="--cfg uuid_unstable", or you'll end up with compilation errors. If this strategy becomes problematic for users we can change unstable features to silently no-op instead of cause compilation failures if the corresponding cfg is not also supplied. Please reach out if that affects you!

Stability commitment

With uuid 1.0 we'll try to stay on that version "forever". There won't be a 2.0 unless there's a very compelling need for it. That means you should feel safe depending on Uuid in the public API of your libraries if you want to.

1.0.0-alpha.1

18 Nov 02:15
b98c958
Compare
Choose a tag to compare
1.0.0-alpha.1 Pre-release
Pre-release

This release includes a huge amount of work from a lot of contributors. I'll try call out breakage here as well as in release notes once we're ready to merge so everyone knows what to expect.

Changes since the last release

0.8.2...main

Contributions since the last release

@Gaelan @hecsalazarf @Expyron @saiintbrisson @tshepang @Tehnix @Takashiidobe

With a special thanks to:

@kinggoesgaming @QnnOkabayashi @Nugine

Highlights

Parsing and formatting methods are now much faster, and work in const too! On my i9 9900K Windows desktop, the difference looks something like this:

Case 1.0.0-alpha.1 0.8.3
parse_invalid_character 40 ns/iter (+/- 0) 39 ns/iter (+/- 1)
parse_invalid_group_len 47 ns/iter (+/- 1) 52 ns/iter (+/- 5)
parse_invalid_groups 58 ns/iter (+/- 1) 58 ns/iter (+/- 0)
parse_invalid_len 57 ns/iter (+/- 2) 6 ns/iter (+/- 0)
parse_nil 16 ns/iter (+/- 0) 50 ns/iter (+/- 4)
parse_nil_hyphenated 17 ns/iter (+/- 0) 59 ns/iter (+/- 2)
parse_random 16 ns/iter (+/- 0) 42 ns/iter (+/- 1)
parse_random_hyphenated 18 ns/iter (+/- 0) 51 ns/iter (+/- 2)
parse_urn 18 ns/iter (+/- 0) 51 ns/iter (+/- 1)

You can go one step further and look at the uuid-simd library for vectorized UUID parsing. It's fast!

You can create UUIDs at compile time using the uuid! macro:

#[macro_use]
extern crate uuid;

use uuid::Uuid;

const ID: Uuid = uuid!("67e55044-10b1-426f-9247-bb680e5fe0c8");

Enable the macro-diagnostics crate feature to get better diagnostics from uuid! using a procedural macro.

Breaking changes

Relocation of adapter::compact

This module can now be found in serde::compact. It can be combined with #[serde(with)] to serialize a Uuid using a more compact representation. We originally moved to this representation directly, but discovered it comes with its own drawbacks that aren't suitable for all formats.

Infallible constructors

The following methods have been changed to accept a &[u8; N] instead of a &[u8], making them infallible instead of returning a Result:

  • Uuid::from_fields
  • Uuid::from_fields_le
  • Uuid::new_v1
  • Builder::from_fields
  • Builder::from_fields_le

Infallible get_variant

The Uuid::get_variant method now returns a Variant instead of an Option<Varaint>, because it's not actually possible for it to ever be None.

Uuid::to_timestamp is now Uuid::get_timestamp

The Uuid::to_timestamp method has been renamed to Uuid::get_timestamp to make it more consistent with Uuid::get_version and Uuid::get_variant.

Changes to formatting methods

The following methods that produce formatting adapters have been renamed:

  • Uuid::to_hyphenated -> Uuid::hyphenated
  • Uuid::to_simple -> Uuid::simple
  • Uuid::to_urn -> Uuid::urn

The following types have been removed:

  • HyphenatedRef
  • SimpleRef
  • UrnRef

The following methods have been changed to return a &<AdapterType> instead of an <AtapterType>Ref:

  • Uuid::to_hyphenated_ref -> Uuid::as_hyphenated
  • Uuid::to_simple_ref -> Uuid::as_simple
  • Uuid::to_urn_ref -> Uuid::as_urn

Builder method consistency

The Builder::build method has been renamed to Builder::into_uuid, to complement the <AdapterType>::into_uuid methods. It also gets an equivalent Builder::as_uuid method.

Version and Variant are non-exhaustive

The #[non_exhaustive] attribute has been added to Version and Variant. There are already active proposals for new UUID versions, so these are likely to continue evolving in the future.

Removed winapi support

The Uuid::to_guid and Uuid::from_guid methods have been removed. This was done for two reasons:

  • We need to avoid unstable winapi types in the stable uuid public API.
  • Whether or not GUID fields need to be flipped to convert into a UUID depends on the source of the GUID, so we can't really offer a single pair of methods to convert a GUID into a UUID.

There are some examples in the repository root that demonstrate how to convert GUIDs into UUIDs as a replacement.

Building with --all-features

Now that uuid includes unstable features, if you're building with --all-features (such as in package manager scenarios), you'll also need to pass RUSTFLAGS="--cfg uuid_unstable", or you'll end up with compilation errors. If this strategy becomes problematic for users we can change unstable features to silently no-op instead of cause compilation failures if the corresponding cfg is not also supplied. Please reach out if that affects you!

Stability commitment

Once uuid releases 1.0 we'll try to stay on that version "forever". There won't be a 2.0 unless there's a very compelling need for it. That means you should feel safe depending on Uuid in the public API of your libraries if you want to.

uuid 0.8.2: API and feature cleanups

11 Jan 06:18
b68733d
Compare
Choose a tag to compare

This release includes a large number of internal refactorings and changes to dependencies.

The 0.8.x releases are now tracked on the 0.8.x branch of uuid. The main branch now contains breaking changes.

Contributions

  • Update md5 to 0.7 (#442)
  • Use getrandom instead of rand (#447)
  • Remove dependency on serde_derive (#478)
  • Add WASI support (#477)
  • Fix some links in the docs (#471)
  • Make Uuid #[repr(transparent)] (#468)
  • Fix the example in the readme (#467)
  • Clarify documentation around rand crate (#489)
  • Fix an incorrect date mentioned in the docs (#496)
  • Update getrandom to 0.2.0 (#501)
  • Improve deserialization error message (#505)
  • Update docs on wasm features (#506)

uuid 0.8.1: Docs

18 Oct 22:14
fb62500
Compare
Choose a tag to compare

This release doesn't contain any source changes, it fixes up errors in the docs, adds clarification and more examples.

Contributions

  • Tidy up some docs. (#434)

uuid 0.8.0: API polish and consolidation

18 Oct 12:25
aa6d78f
Compare
Choose a tag to compare

This release is pretty substantial; it's the accumulation of some 8 months of work. It includes changes to error types, 128bit integer support, explicit endianness and V1 timestamps.

Contributions

uuid 0.7.4: Work docs.rs work!!!

28 Mar 21:26
Compare
Choose a tag to compare

Fixes

  • docs.rs builds now will work properly again. (#385)

Anyone interested can see the entire diff between 0.7.3 and 0.7.4 here.

uuid 0.7.3: Fast strings

25 Mar 02:52
Compare
Choose a tag to compare

Added

  • The uuid::Error error type. This is a sumtype of uuid::BytesError and uuid::ParseError.(#373)
    • Useful when the underlying uuid version and its error types don't matter until an error occurs.
  • Add encode_{lower, upper} for the uuid::adapter::{ Hyphenated, Simple, Urn }(#378)
  • Relatedly, added uuid::Uuid::encode_buffer for the buffer used in the encode_{lower,upper} functions.(#378)

Changes

  • Remove the rand dependency for v3 and v5 Uuids. (#371)

Anyone interested can see the entire diff between 0.7.2 and 0.7.3 here.

uuid 0.7.2: Microsoft love

29 Jan 06:56
Compare
Choose a tag to compare

Added

  • Support for winapi GUIDs, with guid feature (#336, #338)
  • Introduce Uuid builder interface (#332)
  • Support for compact serialization of uuid::Uuid and related types with uuid::adapter::compact::{serialize,deserialize) (#331)
    • use serde_derive's #[serde(with = "uuid::adapter::compact::dense_serde")] you can for your specific case with attributes.
  • Add support for functions that provide uuids in little endian format (#311)
    • By default, the internal representation of uuid::Uuids is unspecified.
    • However all functions returning the bytes are guaranteed to be big endian

Changes

  • Use hyphenated string instead of a raw bytes for uuid::Uuid Debug output (#360)
  • Adjust the error message for uuid::parser::Error::InvalidCharacter for clarity. (#355)

Fixes

  • uuid::Uuid::new_v4 compiles on wasm32 but panics at execution (#351, #358)

Dependencies


Anyone interested can see the entire diff between 0.7.1 and 0.7.2 here.