Skip to content

Commit a59b519

Browse files
committed
feat(http1): add UpgradeableConnection::into_parts
This allows the connection to be deconstructed into I/O object and some additional information, provided it hasn't yet been upgraded.
1 parent 223edef commit a59b519

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/server/conn/http1.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,12 @@ where
522522
Pin::new(conn).graceful_shutdown()
523523
}
524524
}
525+
526+
/// Return the inner IO object, and additional information provided the connection
527+
/// has not yet been upgraded.
528+
pub fn into_parts(self) -> Option<Parts<I, S>> {
529+
self.inner.map(|conn| conn.into_parts())
530+
}
525531
}
526532

527533
impl<I, B, S> Future for UpgradeableConnection<I, S>

0 commit comments

Comments
 (0)