1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use std::ops::{Deref, DerefMut};

use hyper::{body::Incoming, http::request::Builder};

pub struct Request(pub(crate) hyper::http::Request<hyper::body::Incoming>);

impl Request {
    pub fn builder() -> Builder {
        Builder::new()
    }
}

impl Deref for Request {
    type Target = hyper::http::Request<hyper::body::Incoming>;

    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl DerefMut for Request {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}

impl From<hyper::http::Request<Incoming>> for Request {
    fn from(value: hyper::http::Request<Incoming>) -> Self {
        Self(value)
    }
}