Hello, fellow Rustaceans,
As you know that uuid
v0.7.0-beta
was released last week and as the changes in the release are very significant, we saw it fit to write up a transition guide for previous users of uuid
.
The major focus of this release was refactoring the codebase for maintainability and general use. In the process, we ended up with some breaking changes.
- The minimum rust version was bumped from
1.18.0
to1.22.0
. - Items in the
uuid
prelude that have been refactored may need to adjustment accordingly. 0.7.0
splits returning error into 2:uuid::parser::ParseError
, for string errors anduuid::BytesError
, for handling slices.
uuid::BytesError
: Added. Provides error information on slices that processed for Uuid creation.uuid::Hyphenated
: Refactored touuid::adapter::HyphenatedRef
.uuid::Simple
: Refactored touuid::adapter::SimpleRef
.uuid::NAMESPACE_DNS
: Refactored touuid::Uuid::NAMESPACE_DNS
.uuid::NAMESPACE_OID
: Refactored touuid::Uuid::NAMESPACE_OID
.uuid::NAMESPACE_URL
: Refactored touuid::Uuid::NAMESPACE_URL
.uuid::NAMESPACE_X500
: Refactored touuid::Uuid::NAMESPACE_X500
.uuid::ParseError
: Refactored touuid::parser::ParseError
. The error now provides better context details for people who want to handle the error.uuid::Urn
: Refactored touuid::adapter::UrnRef
.uuid::Uuid
as_bytes(&self) -> &[u8; 16]
: Refactored toas_bytes(&self) -> &uuid::Bytes
.from_bytes(b: &[u8]) -> Result<uuid::Uuid, uuid::ParseError>
: Refactored tofrom_slice(b: &[u8]) -> Result<uuid::Uuid, uuid::BytesError>
.from_fields(d1: u32, d2: u16, d3: u16, d4: &[u8]) -> Result<uuid::Uuid, uuid::ParseError>
: Refactored tofrom_fields(d1: u32, d2: u16, d3: u16, d4: &[u8]) -> Result<uuid::Uuid, uuid::BytesError>
.from_random_bytes(b: [u8; 16]) -> Uuid
: Refactored tofrom_random_bytes(bytes: uuid::Bytes) -> uuid::Uuid
.from_uuid_bytes(bytes: uuid::UuidBytes) -> uuid::Uuid
: Refactored tofrom_bytes(bytes: uuid::Bytes) -> uuid::Uuid
.hyphenated(&self) -> uuid::Hyphenated
: Refactored toto_hyphenated_ref(&self) -> uuid::adapter::HyphenatedRef
get_variant(&self) -> Option<uuid::UuidVariant>
: Refactored toget_variant(&self) -> Option<uuid::Variant>
.get_version(&self) -> Option<uuid::UuidVersion>
: Refactored toget_version(&self) -> Option<uuid::Version>
.new(v: uuid::UuidVersion) -> Option<uuid::Uuid>
: Removed, as the result of the function was dependant on the feature gates that are active. Use any of thenew_*
functions or other constructors instead.new_v1<T: uuid::UuidV1ClockSequence>(context: &T, seconds: u64, nsecs: u32, node: &[u8]) -> Result<uuid::Uuid, uuid::ParseError>
: Refactored tonew_v1<T>(context: &T, seconds: u64, nano_seconds: u32, node_id: &[u8]) -> Result<Self, BytesError> where T: uuid::v1::ClockSequence
.new_v3(namespace: &uuid::Uuid, name: &str) -> uuid::Uuid
: Refactored tonew_v3(namespace: &Uuid, name: &[u8]) -> Uuid
new_v5(namespace: &uuid::Uuid, name: &str) -> uuid::Uuid
: Refactored tonew_v5(namespace: &uuid::Uuid, name: &[u8]) -> uuid::Uuid
simple(&self) -> uuid::Simple
: Refactored toto_simple_ref(&self) -> uuid::adapter::SimpleRef
urn(&self) -> uuid::Urn
: Refactored toto_urn_ref(&self) -> uuid::UrnRef
uuid::UuidBytes
: Renamed touuid::Bytes
.uuid::UuidVariant
: Renamed touuid::Variant
.uuid::UuidVersion
: Renamed touuid::Version
.- A new enum variant for
Nil
uuid.
- A new enum variant for
uuid::UuidClockSequence
: Refactored touuid::v1::ClockSequence
.uuid::UuidV1Context
: Refactored touuid::v1::Context
.uuid::adapter::Hyphenated
: Added. Adaptor over owneduuid::Uuid
s for hyphenated strings.uuid::adapter::Simple
: Added. Adaptor over owneduuid::Uuid
s for simple strings.uuid::adapter::Urn
: Added. Adaptor over owneduuid::Uuid
s for urn strings.uuid::parser::Expected
: Added. Provides context detail foruuid::parser::ParseError