Variant
enum and Guid::variant
method.Guid::from_random_bytes
constructor.Guid::is_zero
method.Guid::version
method.time_low
field to/from bytes now treat that field as native endian rather than little endian.Guid::from_str
.guid!
and aligned_guid!
have been improved by marking the parse_or_panic
method track_caller
.AlignedGuid
has been removed.Guid
is now 4-byte aligned.Guid
are now private. It is no longer possible to directly construct Guid
; one of the constructors such as guid!
, Guid::new
, or Guid::from_bytes
must be used instead. New accessor methods have been added for each of the internal fields.Guid::parse_or_panic
and AlignedGuid::parse_or_panic
. These have the same functionality as the corresponding try_parse
methods, except they will panic on failure. This is useful in const
contexts where the panic is used as a compilation error.guid!
and aligned_guid!
macros now force const evaluation of the input. This was the intended behavior before, but it was not implemented correctly. Any new compilation failures caused by this change indicate a bug in the calling code.Guid
back to repr(C)
instead of repr(C, align(1))
. Even though the alignment of the struct is 1-byte either way, structs with any alignment set are not allowed in packed structures so this was a breaking change.AlignedGuid
, which is identical to Guid
except the struct is 8-byte aligned instead of 1-byte aligned.Guid
and AlignedGuid
types implement From
for each other to convert between them.aligned_guid!
macro, which is identical to the guid!
macro except it creates an AlignedGuid
instead of a Guid
.This release was yanked due to accidentally changing the repr of Guid
.
bytemuck
and serde
.doc_auto_cfg
on docs.rs.GuidFromStrError
into an enum with three variants to allow for better error messages.Guid::from_bytes
constructor.Guid::to_bytes
const.bytemuck
dependency.bytemuck
dependency optional with the new bytemuck
feature.Guid::to_ascii_hex_lower
method. This is a const function that creates a [u8; 36]
array containing the GUID in standard xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
format.serde
feature (disabled by default) that implements serde's Serialize
and Deserialize
traits for the Guid
type.From<ParseIntError>
impl for GuidFromStrError
.