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

Implement HasContext for &impl HasContext #248

Open
notgull opened this issue Apr 26, 2023 · 2 comments
Open

Implement HasContext for &impl HasContext #248

notgull opened this issue Apr 26, 2023 · 2 comments

Comments

@notgull
Copy link
Contributor

notgull commented Apr 26, 2023

I have an API that takes a type generic over the HasContext trait. It would be nice if you could also pass in &Context, Rc<Context> and other types in this way.

@grovesNL
Copy link
Owner

What would the implementation look like?

@notgull
Copy link
Contributor Author

notgull commented Oct 11, 2023

It would probably be a macro that implements HasContext over Rc<T>, &T and others as methods that are just forwarded to the inner HasContext implementation.

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