hyperium / h2

HTTP 2.0 client & server implementation for Rust.
MIT License
1.34k stars 269 forks source link

add accessor for StreamId u32 #639

Closed ehaydenr closed 1 year ago

LucioFranco commented 1 year ago

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

ehaydenr commented 1 year ago

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 https://github.com/hyperium/h2/blob/756e2524ac53c0cf9810efcba0b92171b7d80e42/src/frame/stream_id.rs#L86 Happy to change if desired.

LucioFranco commented 1 year ago

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