- Added
Variant
enum andGuid::variant
method. - Added
Guid::from_random_bytes
constructor. - Added
Guid::is_zero
method. - Added
Guid::version
method. - Conversions of the
time_low
field to/from bytes now treat that field as native endian rather than little endian. - Fix non-upper-case-globals linter warning.
- Bump MSRV to 1.68.
- Add docstring for
Guid::from_str
.
- Fix typo in readme.
- Error messages from
guid!
andaligned_guid!
have been improved by marking theparse_or_panic
methodtrack_caller
. AlignedGuid
has been removed.Guid
is now 4-byte aligned.- The fields of
Guid
are now private. It is no longer possible to directly constructGuid
; one of the constructors such asguid!
,Guid::new
, orGuid::from_bytes
must be used instead. New accessor methods have been added for each of the internal fields.
- Copied the license files into each package so that the archives on crates.io include them.
- Add
Guid::parse_or_panic
andAlignedGuid::parse_or_panic
. These have the same functionality as the correspondingtry_parse
methods, except they will panic on failure. This is useful inconst
contexts where the panic is used as a compilation error. - The
guid!
andaligned_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.
- Change
Guid
back torepr(C)
instead ofrepr(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.
- Add
AlignedGuid
, which is identical toGuid
except the struct is 8-byte aligned instead of 1-byte aligned. - The
Guid
andAlignedGuid
types implementFrom
for each other to convert between them. - Add
aligned_guid!
macro, which is identical to theguid!
macro except it creates anAlignedGuid
instead of aGuid
.
This release was yanked due to accidentally changing the repr of Guid
.
- Relax version requirements for
bytemuck
andserde
. - Enable
doc_auto_cfg
on docs.rs.
- Fix license links in README, take two.
- Fix license links in README.
- Allow the MIT license to be used in addition to Apache-2.0.
- Make
GuidFromStrError
into an enum with three variants to allow for better error messages.
- Add a const
Guid::from_bytes
constructor. - Make
Guid::to_bytes
const. - Remove re-export of
bytemuck
dependency. - Make the
bytemuck
dependency optional with the newbytemuck
feature.
- Add
Guid::to_ascii_hex_lower
method. This is a const function that creates a[u8; 36]
array containing the GUID in standardxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
format. - Add
serde
feature (disabled by default) that implements serde'sSerialize
andDeserialize
traits for theGuid
type. - Remove unused
From<ParseIntError>
impl forGuidFromStrError
.