new Rust implementation
Hey everyone,
I've got a new Rust implementation of the TypeId spec that I'd love to share. It's called mti and it offers a different approach by adding extensions to strings, allowing them to behave and parse like TypeIds while maintaining type safety.
What's cool about this implementation:
-
It's split into three crates:
- mti (the main crate, which combines the other two)
- TypeIdSuffix
- TypeIdPrefix
-
The TypeIdSuffix and TypeIdPrefix crates are designed for independent use. They've been thoroughly fuzz tested, prop tested, and formally verified.
-
Both the mti and TypeIdPrefix crates include an optional prefix sanitization feature, which guarantees a valid prefix is created even from bad data.
-
This split design allows for some neat tricks in high-volume data pipeline processing. For example, you can generate prefixes and suffixes separately and combine them later to maintain high throughput.
I've been using this in a distributed actor framework I'm working on, and it's been pretty slick so far.
Future plans:
- Exposing these crates to JavaScript and PHP, reusing the Rust core.
Thanks for all your hard work on the spec! Let me know if you need any more info or if you'd like to include this implementation.
@rrrodzilla Thanks for putting together this crate. It looks great.
Two quick thoughts:
-
In the crate's README (https://crates.io/crates/mti) the link to
Jetifyisjetify.iobut that's a dead page, it should actually bejetify.com– if you don't mind updating it :) -
Let's go ahead and advertise your implementation in our typeid README. Do you want to go ahead and send me a PR modifying this table: https://github.com/jetify-com/opensource/blob/main/typeid/typeid/README.md#community-provided-implementations – we'd be happy to approve it and merge it in.