1 | //! # hyper-tls |
2 | //! |
3 | //! An HTTPS connector to be used with [hyper][]. |
4 | //! |
5 | //! [hyper]: https://hyper.rs |
6 | //! |
7 | //! ## Example |
8 | //! |
9 | //! ```no_run |
10 | //! use bytes::Bytes; |
11 | //! use http_body_util::Empty; |
12 | //! use hyper_tls::HttpsConnector; |
13 | //! use hyper_util::{client::legacy::Client, rt::TokioExecutor}; |
14 | //! |
15 | //! #[tokio::main(flavor = "current_thread" )] |
16 | //! async fn main() -> Result<(), Box<dyn std::error::Error>>{ |
17 | //! let https = HttpsConnector::new(); |
18 | //! let client = Client::builder(TokioExecutor::new()).build::<_, Empty<Bytes>>(https); |
19 | //! |
20 | //! let res = client.get("https://hyper.rs" .parse()?).await?; |
21 | //! assert_eq!(res.status(), 200); |
22 | //! Ok(()) |
23 | //! } |
24 | //! ``` |
25 | //! |
26 | //! ## Crate Features |
27 | //! |
28 | //! - `alpn`: Enables `native-tls/alpn`, and if `h2` is negotiated, tells hyper. |
29 | #![doc (html_root_url = "https://docs.rs/hyper-tls/0.6.0" )] |
30 | #![cfg_attr (test, deny(warnings))] |
31 | #![deny (missing_docs)] |
32 | #![deny (missing_debug_implementations)] |
33 | |
34 | #[doc (hidden)] |
35 | pub extern crate native_tls; |
36 | |
37 | pub use client::{HttpsConnecting, HttpsConnector}; |
38 | pub use stream::{MaybeHttpsStream, TlsStream}; |
39 | |
40 | mod client; |
41 | mod stream; |
42 | |