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

add accessor for StreamId u32 #639

Merged
merged 2 commits into from Oct 21, 2022
Merged

Conversation

ehaydenr
Copy link
Contributor

No description provided.

Copy link
Collaborator

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it seems pretty reasonable to add this. It is a public API commitment that a StreamId will always be convertible into a u32, but since the HTTP/2 standard defines stream IDs as being 31 bits, I think that's a pretty safe commitment for this library to make...

@LucioFranco
Copy link
Member

Should it be a From impl or a get() -> u32?

@ehaydenr
Copy link
Contributor Author

ehaydenr commented Oct 6, 2022

Doesn't make a huge difference to me. I find the From impl natural and this is exactly how it's done in the private StreamId type

impl From<StreamId> for u32 {
Happy to change if desired.

@LucioFranco
Copy link
Member

Personally, I don't like the hidden from statements but we could just add a get_u32 that is clear and verbose.

@LucioFranco LucioFranco merged commit 79dff0c into hyperium:master Oct 21, 2022
@ehaydenr ehaydenr deleted the accessor branch October 21, 2022 20:11
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

3 participants