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

Proposal: add method to claim pointer, or mutable reference to member of a introspected struct #2

Open
tema3210 opened this issue Aug 8, 2019 · 5 comments

Comments

@tema3210
Copy link

tema3210 commented Aug 8, 2019

No description provided.

@iddm
Copy link
Owner

iddm commented Aug 9, 2019

Could you be more specific, please? What exactly do you propose, what goal you are trying to achieve?

@tema3210
Copy link
Author

tema3210 commented Aug 13, 2019

You are generating descriptive struct, but don't provide acessor to field itself, it would be much more useful if you add something like dictionary of string naming methods to struct storing offset of the field in introspectable struct. Provide unsafe method to acess the fields data, by taking the pointer to struct itself.
Think about type safety and borrow safety

@tema3210
Copy link
Author

This kind of Introspection would be useful for library authours.

@iddm
Copy link
Owner

iddm commented Aug 14, 2019

Well, I have never been thinking about this crate much because I made it just for my own understanding of things, but you gave me a good task. To be honest, I have already been doing something like that in this crate but never committed and pushed, because the interface I was making was ugly. Now I have some better ideas and, perhaps, I will be able to produce something in the near future. However, I can't spend much time on this right now, so don't expect this to board just soon please.

@tema3210
Copy link
Author

See this, there my thoughts about interface. rust-lang/rfcs#2743

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants