-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking API features and refactoring for 0.8
#427
Conversation
0.8
Since this is a pretty big PR I'm trying to keep the individual commits clean so it should be easier to follow along. |
This TODO bot is a bit of a nuisance... |
09b1d0b
to
45e8bc9
Compare
45e8bc9
to
be51f82
Compare
Draft implementation of improved timestamp api discussed in github issue #405. Establishes new `Timestamp` struct in v1 mod that stores the (timestamp, counter) values that had been used previously. The core rationale/improvement is that `Timestamp` offers several conversion routines to/from RFC4122 and unix timestamp formats. The RFC4122 timestamp format in V1 UUIDs is relatively obscure -- this provides ready access to unix timestamp formats instead. The design also prevents possible confusion/misuse by use of clearly named constructors and ample documentation about the various formats in play. Tests covering previously existing functionality updated to reflect new api and passing. New functionality untested. Moved `Uuid::to_timestamp` from impl in src/lib.rs to v1 mod as it requires access to the new `Timestamp` struct defined in v1. Noting as this places `to_timestamp` behind the v1 feature gate, unlike prior to the change.
7692907
to
a09fbad
Compare
7eaa119
to
657553c
Compare
657553c
to
2497ac7
Compare
(about the todo bot) |
Also @KodrAus this is still a WIP right? |
@kinggoesgaming I think this is ready for a review now 👍 There’s definitely more docs work to do and we can consider how to expose richer info out of our errors but I don’t think that needs to block a review or possible merge. |
bors r+ |
427: Breaking API features and refactoring for `0.8` r=kinggoesgaming a=KodrAus **I'm submitting a(n)** (|feature|refactor|) # Description ## Modules and Errors This PR is a broad refactoring of our error types and module layout. The general pattern I've gone for is: - Define specific error types in submodules. These are currently private. - Collect these specific error types in an opaque root `Error`. All methods return this single `Error` type so it's easier for consumers to carry `uuid::Error`s in their own code. It'll also include some implementations for open PRs as we've been discussing. I imagine we'll want to spend time working through these changes :) I've hidden our `prelude` module for now, because I'm not sure it's something we'll want to stabilize with (it's only got a few bits in it afterall). ## 128bit support Re-enables support for 128-bit numbers in the form of constructors on `Uuid`, following the pattern that method names without an endian suffix are BE. ## No-std Refactors our `no-std` support so we always mark the crate as `no-std` so our std imports are always the same. This simplifies our std/core support so we need fewer modules. ## Timestamps Includes the design proposed in #405 for timestamp support originally implemented by @jonathanstrong. # Related Issue(s) - #406 # Related PR(s) - #405 - #416 Co-authored-by: Ashley Mannix <ashleymannix@live.com.au> Co-authored-by: Jonathan Strong <jonathan.strong@gmail.com>
433: Prepare for 0.8.0 release r=Dylan-DPC a=KodrAus Closes #431 [Changeset since the last release](0.7.4...master) Includes: - #427 - #419 - #424 - #418 - #413 - #407 - #404 - #400 - #399 - #398 - #397 - #396 - #394 - #393 - #390 - #389 - #388 I've also added some docs to the 128bit integer methods to clarify how they're different than `to_fields` (for consistency with other uuid libs in the wild). Co-authored-by: Ashley Mannix <ashleymannix@live.com.au>
I'm submitting a(n) (|feature|refactor|)
Description
Modules and Errors
This PR is a broad refactoring of our error types and module layout. The general pattern I've gone for is:
Error
. All methods return this singleError
type so it's easier for consumers to carryuuid::Error
s in their own code.It'll also include some implementations for open PRs as we've been discussing. I imagine we'll want to spend time working through these changes :)
I've hidden our
prelude
module for now, because I'm not sure it's something we'll want to stabilize with (it's only got a few bits in it afterall).128bit support
Re-enables support for 128-bit numbers in the form of constructors on
Uuid
, following the pattern that method names without an endian suffix are BE.No-std
Refactors our
no-std
support so we always mark the crate asno-std
so our std imports are always the same. This simplifies our std/core support so we need fewer modules.Timestamps
Includes the design proposed in #405 for timestamp support originally implemented by @jonathanstrong.
Related Issue(s)
Related PR(s)
Uuid::to_utc() -> Option<DateTime<Utc>>
) #405