-
Notifications
You must be signed in to change notification settings - Fork 4
feat: introduce ID crate #330
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
Conversation
f7b298c
to
2e31c2d
Compare
99f4dfe
to
c3da646
Compare
id/src/lib.rs
Outdated
/// if you need to use `MySpecialType` instead of [`Uuid`] for your special type of tagged type. | ||
/// </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// if you need to use `MySpecialType` instead of [`Uuid`] for your special type of tagged type. | |
/// </div> | |
/// if you need to use `MySpecialType` instead of [`Uuid`] for your special type of tagged type. | |
/// </div> |
Please note that if you want to put markdown in the HTML tag and for it to be interpreted as such, you need to have an empty line between the HTML tags and your markdown content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For unknown reasons the doctests crash on the id crate in CI.
I don't have time to debug at the moment.
I note we don't run doctests anywhere else at the moment; dataplane
's pipeline
module has examples, but the package is a binary and the module is not public, so its examples aren't run as part of the doctests (rust-lang/rust#50784).
The error says:
Couldn't run the test: Permission denied (os error 13) - maybe your tempdir is mounted with noexec?
So maybe we should try removing the noexec
in the justfile
? I think you had that in a PR recently, didn't you? Or was it a previous iteration of this one, maybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks OK to me, but could you provide more details on the use case you have in mind, please?
You can take a look at #320 where I will move from my internal version of this to a similar construct. But perhaps a better description in the PR is warranted. |
Sure. The motivation is to distinguish different types of IDs which we expect to use in configuration. I am confident we will end up with multiple tables of configuration data, and keeping the IDs of VPCs compile time distinct from the IDs of nat rules can make things easier and less error-prone. A function which returns or accepts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give a better PR message for motivation and then I am good to merge this. I'll probably add some stuff to this crate for mapping IDs to human readable strings.
c3da646
to
80efb3c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK sounds good, thanks a lot!
We'll need to take a look into these doctests issue at some point though, or we won't be able to test examples in the docs 😢 |
In the future, we can put the motivation in the commit log. I don't think it is worth holding up this PR just for that though. Something to keep in mind for the future. |
See docs in crate for details Signed-off-by: Daniel Noland <[email protected]>
For unknown reasons the doctests crash on the id crate in CI. I don't have time to debug at the moment. Hopefully this change can be reverted later. Signed-off-by: Daniel Noland <[email protected]>
80efb3c
to
823d5dd
Compare
See docs in crate for details
I hope to make this useful in other crates shortly.