Add a new trait, UuidV1ClockSequence which defines the interface for generating clock sequences. #137

Merged
radix merged 2 commits from 106-generic-context into master 2018-02-08 13:25:12 -06:00
radix commented 2018-02-05 20:33:46 -06:00 (Migrated from github.com)
  • new_v1 now takes any implementor of UuidV1ClockSequence, instead of just UuidV1Context.
  • UuidV1Context implements UuidV1ClockSequence, but ignores the seconds and nanoseconds arguments.

This takes a more conservative approach. No changes to the way UuidV1Context generates sequences, but now other people can implement their own clock-sequence generators.

The nice thing is that I think this is entirely backwards compatible (which means that this didn't need to block 1.0).

This is meant to address #106. It does not implement all the suggestions that it had, but it allows users to, and also allows us to add more implementations with different clock-sequence strategies in a backwards-compatible way.

* new_v1 now takes any implementor of UuidV1ClockSequence, instead of just UuidV1Context. * UuidV1Context implements UuidV1ClockSequence, but ignores the `seconds` and `nanoseconds` arguments. This takes a more conservative approach. No changes to the way UuidV1Context generates sequences, but now other people can implement their own clock-sequence generators. The nice thing is that *I think* this is entirely backwards compatible (which means that this didn't need to block 1.0). This is meant to address #106. It does not implement all the suggestions that it had, but it allows users to, and also allows us to add more implementations with different clock-sequence strategies in a backwards-compatible way.
Dylan-DPC-zz (Migrated from github.com) approved these changes 2018-02-06 09:55:43 -06:00
kinggoesgaming (Migrated from github.com) approved these changes 2018-02-06 14:27:29 -06:00
kinggoesgaming (Migrated from github.com) left a comment

👍 from me

:+1: from me
KodrAus (Migrated from github.com) approved these changes 2018-02-06 15:54:30 -06:00
Dylan-DPC-zz commented 2018-02-08 13:18:36 -06:00 (Migrated from github.com)

bors: r+

bors: r+
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-uuid-rs/uuid!137
No description provided.