Comments (4)
Just coming back through some triage. It looks like as nice as this would be a to do, we probably can't in a non-breaking way, so I'll go ahead and close this one for now. We might be able to revisit it in the future if things change.
from uuid.
Hi @azdle 👋 This is a great suggestion 👍 I'd consider loosening that bound to be a minor change (the old API evolution RFC thinks so too). You're right that inference would break, like in this example:
let uuid = Uuid::new_v5(ns, name.as_ref());
but I think that's ok. These aren't really widely used methods and the proposed signature is better.
from uuid.
The ideal signature would probably simply be:
fn new_v5(namespace: &Uuid, name: impl Hash) -> Uuid
from uuid.
I looked into this, and it's unfortunately not as straight-forward as you'd hope. The standard hash
APIs aren't really compatible with md5
or sha1
, and when wrapped the hashing of slices produces different results than it previously did.
I think the best approach for now will be to add some examples to the project that show how you can convert something that implements Hash
into a slice to pass to new_v5
.
from uuid.
Related Issues (20)
- Unable to activate feature "v7" HOT 6
- Request: add configuration to enable/disable deserializing different formats HOT 2
- Wrapping behavior of `impl ClockSequence for Context` HOT 4
- Export `error::InvalidUuid` HOT 2
- Make &'a Uuid serializable HOT 3
- UUID no longer supports serde derive attributes HOT 2
- Add bytemuck support HOT 1
- Add `prost::Message` implementation for `Uuid` HOT 3
- v7 should have a counter option? HOT 36
- Macros from 1.5.0 to 1.6.0 break. HOT 4
- Investigate crate size HOT 2
- Idiotmatic naming: drop/replace `get_` prefixes HOT 4
- 1.7.0 breaking change HOT 2
- Initialization of CONTEXT in timestamp::context::shared_context() not thread-safe HOT 1
- the trait Deserialize is not implemented for `Uuid` HOT 2
- TryFrom<Vec<u8>> makes an unnecessary copy HOT 1
- `uuid!` `index is out of bounds` in clippy on rust 1.77 (fixed in uuid 1.6.1)
- Why does Uuid implement Ord, PartialOrd? HOT 1
- uuid!() macro can't handle a constant &str passed in HOT 2
- Special UUIDv7 function for microservices HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uuid.