Skip to content
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

Write a macro to generate namespaced Ids #26380

Closed
gterzian opened this issue May 1, 2020 · 2 comments · Fixed by #26606
Closed

Write a macro to generate namespaced Ids #26380

gterzian opened this issue May 1, 2020 · 2 comments · Fixed by #26606
Labels
A-constellation Involves the constellation A-content/script Related to the script thread C-assigned There is someone working on resolving the issue E-more-complex Variable effort required; may require a mentor. Recommended solution is clearly described in the iss

Comments

@gterzian
Copy link
Member

gterzian commented May 1, 2020

We have a bunch of Indexes and Ids in components/msg/constellation_msg.rs, see for example the BrowsingContextIndex and BrowsingContextId

pub struct BrowsingContextIndex(pub NonZeroU32);

I find myself manually adding new ones regurlarly by hand, perhaps someone wants to write a macro for this? See for example the changes to this file: https://github.com/servo/servo/pull/26317/files#diff-8dc9268416cd4f037d50206e76c73cf9

I'd be great if we could just do something along the lines of namespaced_id!(ServiceWorkerId).

Note that each also require implementing a method on PipelineNamespace, which I guess will have to be done by hand(unless someone has a better idea).

I don't have much, if any, experience writing macros, but I'll venture ahead with a "less easy" label...

@gterzian gterzian added E-more-complex Variable effort required; may require a mentor. Recommended solution is clearly described in the iss A-constellation Involves the constellation A-content/script Related to the script thread labels May 1, 2020
@AbhishekSharma102
Copy link
Contributor

Hey @gterzian, I am new to rust and would like to work on this. Please let me know if no one else is working on this.

@gterzian
Copy link
Member Author

It's not assigned to anyone, so you can do it if you like!

@gterzian gterzian added the C-assigned There is someone working on resolving the issue label May 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-constellation Involves the constellation A-content/script Related to the script thread C-assigned There is someone working on resolving the issue E-more-complex Variable effort required; may require a mentor. Recommended solution is clearly described in the iss
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants