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

Migrate to foreign_type! macro #99

Open
kvark opened this issue Sep 6, 2019 · 2 comments
Open

Migrate to foreign_type! macro #99

kvark opened this issue Sep 6, 2019 · 2 comments

Comments

@kvark
Copy link
Member

kvark commented Sep 6, 2019

See https://docs.rs/foreign-types/0.4.0/foreign_types/
What's not clear to me is how this works with a parent type semantics: current macro in metal-rs supports it and uses it, but I don't see it in the foreign_types crate. cc @sfackler

@sfackler
Copy link

sfackler commented Sep 6, 2019

What do you mean by parent type semantics? Upcasting? You'd probably end up making a separate trait and macro that wraps foreign_types!.

@kvark
Copy link
Member Author

kvark commented Sep 6, 2019

@sfackler I mean this -

type ParentType = $parent_ref:ident;

On a second look, it's just one impl Deref away from what you have. So we can just add it ourselves.

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

No branches or pull requests

2 participants