Request: impl Into, AsRef, AsMut to http::Request
Refs:
@@ -308,6 +308,18 @@ impl<State> Request<State> {
}
}
+impl<State> AsMut<http::Request> for Request<State> {
+ fn as_mut(&mut self) -> &mut http::Request {
+ &mut self.request
+ }
+}
+
+impl<State> AsRef<http::Request> for Request<State> {
+ fn as_ref(&self) -> &http::Request {
+ &self.request
+ }
+}
+
impl<State> Read for Request<State> {
fn poll_read(
mut self: Pin<&mut Self>,
@@ -318,6 +330,12 @@ impl<State> Read for Request<State> {
}
}
+impl<State> Into<http::Request> for Request<State> {
+ fn into(self) -> http::Request {
+ self.request
+ }
+}
+
// NOTE: From cannot be implemented for this conversion because `State` needs to
// be constrained by a type.
impl<State: Send + Sync + 'static> Into<Response> for Request<State> {
