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

feat(h3): allow multi impl #1792

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FrankSpitulski
Copy link

@FrankSpitulski FrankSpitulski commented Mar 26, 2023

Relates to #1558

other impls of hyperium/h3 can implement the H3ConnectionProvider trait allowing use of more than one h3 impl and also further customization of the default quinn transport.

I couldn't work out how to let the user provide a dyn trait without exposing the generic h3 types everywhere. maybe someone who knows rust a bit better can help. the trait should be moved to a user facing package too, but I'd like to get the impl sorted first.

other impls can implement the H3ConnectionProvider trait
@seanmonstar
Copy link
Owner

Thanks for thinking about this! I feel this is similar to the conversation in #1786. In short, I worry about exposing too much of the internals, because then we can't change things around.

@FrankSpitulski
Copy link
Author

FrankSpitulski commented Mar 27, 2023

my goal with this was to allow users to provide “something that implements h3”, which I think is still in the spirit of not too much internals. I just couldn’t get the trait to work without infecting the rest of the library with generics for the h3 concrete type, despite the dyn trait box.

h3 is still part of hyper, and imo sufficiently generalised. I wouldn’t want to directly expose quinn types though.

@FrankSpitulski
Copy link
Author

from what I can tell because the h3 traits have associated types, they are not object safe and cannot be referenced without knowing specifying those impl types.

https://stackoverflow.com/questions/67213532/vector-of-polymorphic-structs-with-an-associated-type-in-trait

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

Successfully merging this pull request may close these issues.

None yet

2 participants