You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'd like to request that hyper::proto::h2::H2Upgraded<T> be made pub, so users can downcast an hyper::upgrade::Upgraded object to access the underlying I/O type for HTTP/2 connections.
Problem
Currently, Upgraded is not Sync, which prevents sending it across threads or storing it in Sync contexts. While HTTP/1 upgraded connections can be downcast using .downcast::<Tokio<TcpStream >>(), but the underlying I/O type for HTTP/2 H2Upgraded<T> is private, making it impossible to downcast and recover the inner IO (which is often Sync).
// This fails to compile — `H2Upgraded` is private
upgraded.downcast::<hyper::proto::h2::H2Upgraded<bytes::Bytes>>()
Hi, I'd like to request that
hyper::proto::h2::H2Upgraded<T>be madepub, so users can downcast anhyper::upgrade::Upgradedobject to access the underlying I/O type for HTTP/2 connections.Problem
Currently,
Upgradedis notSync, which prevents sending it across threads or storing it inSynccontexts. While HTTP/1 upgraded connections can be downcast using.downcast::<Tokio<TcpStream >>(), but the underlying I/O type for HTTP/2H2Upgraded<T>isprivate, making it impossible to downcast and recover the inner IO (which is oftenSync).Note
hyper/src/proto/h2/client.rs
Lines 591 to 593 in be18a92
hyper/src/proto/h2/server.rs
Lines 495 to 503 in be18a92
Upgraded::downcast#3587, but it doesn't solve the problem in the HTTP/2 scenario.Thanks for all the great work on Hyper! I'd be happy to help implement this if you agree.