monoio_netreq/
lib.rs

1extern crate monoio_transports_netreq_fork as monoio_transports;
2
3#[cfg(not(feature = "hyper-tls"))]
4pub mod http;
5mod request;
6mod response;
7mod error;
8#[cfg(any(feature = "hyper", feature = "pool-hyper", feature = "hyper-tls"))]
9pub mod hyper;
10mod key;
11
12pub use error::Error;
13pub use request::HttpRequest;
14pub use response::HttpResponse;
15
16#[derive(Default, Clone, PartialEq, Debug)]
17enum Protocol {
18    Http1,
19    Http2,
20    #[default]
21    Auto,
22}
23
24impl Protocol {
25    pub(crate) fn is_protocol_h1(&self) -> bool {
26        self.eq(&Protocol::Http1)
27    }
28
29    pub(crate) fn is_protocol_h2(&self) -> bool {
30        self.eq(&Protocol::Http2)
31    }
32
33    #[allow(dead_code)]
34    pub(crate) fn is_protocol_auto(&self) -> bool {
35        self.eq(&Protocol::Auto)
36    }
37}