Skip to content

Could the HlistFromRow trait be publically referencable? #149

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

Closed
ch3pjw opened this issue Oct 29, 2024 · 2 comments
Closed

Could the HlistFromRow trait be publically referencable? #149

ch3pjw opened this issue Oct 29, 2024 · 2 comments

Comments

@ch3pjw
Copy link

ch3pjw commented Oct 29, 2024

I'm wondering why the HlistFromRow trait is not publicly referencable (

pub trait HlistFromRow: Sized {
).

I'm trying to implement a trait with an associated HList type that I want to say is always mysql_async::prelude::FromRow, but I don't think I can say that without referencing HlistFromRow directly. I can work around that by putting a FromRow trait bound at the usage site, but that feels overly verbose given that the associated type in the trait I'm implementing should always be FromRow, and the constraint might propagate throughout the rest of my code where it doesn't need to be.

I've sketched the issue out in more detail here: https://gist.github.com/ch3pjw/5c9f5d320cf222eadc158829c4864279

Is your intent to make sure that no-one else can implement HlistFromRow? Is that necessary? Could that be achieved by using a sealed supertrait, if indeed it would be damaging if people were to try implementing it?

As a side point, should the trait be named with a capital LHListFromRow — for consistency with frunk?

Thanks for the library, it's been extremely useful. I'm happy to submit a PR if you think that fits with your design goals.

@blackbeam
Copy link
Owner

@ch3pjw, hi.

Thanks for pointing this out. HlistFromRow turns out to be completely unnecessary and removed in #150. It is unfortunate that it pollutes the public interface.

Please wait for the next release.

@ch3pjw
Copy link
Author

ch3pjw commented Nov 14, 2024

Great news, thanks!

@ch3pjw ch3pjw closed this as completed Nov 14, 2024
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