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

How to construct a ContentLocation? #192

Open
sazzer opened this issue Aug 31, 2024 · 2 comments
Open

How to construct a ContentLocation? #192

sazzer opened this issue Aug 31, 2024 · 2 comments

Comments

@sazzer
Copy link

sazzer commented Aug 31, 2024

I feel like I'm missing something obvious here.

The ContentLocation struct has a private field, so can't be directly constructed. It's also got no new() method and doesn't seem to implement From, TryFrom, FromStr or anything else like that in any useful manner that I can see.

There are also no examples in the RustDoc, and the tests are all in the same module so can construct the struct directly even though my code can't.

So, what am I missing?

Cheers

@seanmonstar
Copy link
Member

You're not missing anything obvious, it looks like the type just doesn't have any useful methods.

When the typed headers were first made as part of hyper, we accidentally exposed too many internals, and it required breaking changes, even for headers that someone might not care about. So when moved into this separate crate, internal privacy was improved, and only conservative methods that don't restrict internal refactors have been added.

It was easier to do that for some types. Others, people just haven't submitted proposals for what conservative methods to add.

@sazzer
Copy link
Author

sazzer commented Aug 31, 2024

So what's the best way to address this? Do I submit a proposal somewhere? Or do I just submit a PR? Or is there some other way?

Cheers

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