-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
hyperium/hyper-util
#147Labels
C-featureCategory: feature. This is adding a new feature.Category: feature. This is adding a new feature.
Description
hyper_util::server::conn::auto::Connection<'a, I, S, E>
internally wraps I
in hyper_util::common::rewind::Rewind<_>
, which is a private type, so we cannot ever make use of Upgraded::downcast_ref
anymore.
While I could expose Rewind<_>
in hyper_util
and improve docs in hyper_util::server::conn::auto
to signal that one should be downcasting to Rewind<I>
, I am filing this in hyper
because I thought of a potentially better resolution:
- Introduce
hyper::server::conn::http1::Builder::serve_buffered_connection
:
impl Builder { pub fn serve_buffered_connection<I, S>(&self, buffered: Bytes, io: I, service: S) -> Connection<I, S> where S: HttpService<IncomingBody>, S::Error: Into<Box<dyn StdError + Send + Sync>>, S::ResBody: 'static, <S::ResBody as Body>::Error: Into<Box<dyn StdError + Send + Sync>>, I: Read + Write + Unpin, { let mut conn = proto::Conn::new_buffered(buffered, io); … } }
- Use that in
hyper_util::server::conn::auto::Builder::serve_connection
instead of wrappingI
intoRewind<_>
.
Metadata
Metadata
Assignees
Labels
C-featureCategory: feature. This is adding a new feature.Category: feature. This is adding a new feature.