• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2023 Huawei Device Co., Ltd.
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 //     http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 #![allow(dead_code)]
15 #![allow(unused_imports)]
16 
17 //! `ylong_http` provides various basic components that `HTTP` needs to use.
18 //! You can use these components to build a HTTP client, a HTTP server, etc.
19 //!
20 //! # Support HTTP Version
21 //! - `HTTP1.1`
22 // TODO: Need doc.
23 
24 #[cfg(feature = "http1_1")]
25 pub mod h1;
26 
27 #[cfg(feature = "http2")]
28 pub mod h2;
29 
30 /// Module that contains the functionality for HTTP/3 support.
31 #[cfg(feature = "http3")]
32 pub mod h3;
33 
34 #[cfg(feature = "huffman")]
35 mod huffman;
36 
37 #[cfg(any(feature = "ylong_base", feature = "tokio_base"))]
38 pub mod body;
39 pub mod error;
40 pub mod headers;
41 pub mod request;
42 pub mod response;
43 pub mod version;
44 
45 pub(crate) mod util;
46 
47 #[cfg(feature = "tokio_base")]
48 pub(crate) use tokio::{
49     fs::File,
50     io::{AsyncRead, AsyncReadExt, AsyncSeekExt, ReadBuf},
51 };
52 #[cfg(feature = "ylong_base")]
53 pub(crate) use ylong_runtime::{
54     fs::File,
55     io::{AsyncRead, AsyncReadExt, AsyncSeekExt, ReadBuf},
56 };
57