WIP: Generalize sequence incrementing and only increment sequences when time doesn't move forwards #136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a big backwards-incompatible change, and WORK-IN-PROGRESS.
UuidV1Context
was renamed toDefaultUuidV1Context
UuidV1Context
is added. This trait has a method for getting a u16 sequence number given the current time.DefaultUuidV1Context
now has a Mutex in it for storing and updating the last time that a sequence number was requested. This means thatDefaultUuidV1Context
is only available when thestd
feature is enabled.Is there any way we can avoid the context? I'm sure it probably slows down new_v1 a lot (though I plan on adding some benchmarks for this).
Also, while #106 proposed changing
UuidV1Context
to a trait, I think this might be unnecessary churn. A trait is a good idea, but it should probably be called something else so thatUuidV1Context
can remain backwards compatible.