• 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 //! HTTP asynchronous client module.
15 //!
16 //! This module provides asynchronous client components.
17 //!
18 //! - [`Client`]: The main part of client, which provides the request sending
19 //! interface and configuration interface. `Client` sends requests in an
20 //! asynchronous manner.
21 //!
22 //! - [`Connector`]: `Connector`s are used to create new connections
23 //! asynchronously. This module provides `Connector` trait and a `HttpConnector`
24 //! which implements the trait.
25 
26 mod client;
27 mod connector;
28 
29 mod dns;
30 mod downloader;
31 mod http_body;
32 mod request;
33 mod response;
34 mod timeout;
35 mod uploader;
36 
37 #[cfg(feature = "__tls")]
38 mod ssl_stream;
39 
40 #[cfg(feature = "__tls")]
41 pub(crate) mod mix;
42 
43 pub(crate) mod conn;
44 pub(crate) mod pool;
45 #[cfg(feature = "http3")]
46 mod quic;
47 
48 pub use client::ClientBuilder;
49 pub use connector::{Connector, HttpConnector};
50 pub use downloader::{DownloadOperator, Downloader, DownloaderBuilder};
51 pub use http_body::HttpBody;
52 #[cfg(feature = "http3")]
53 pub use quic::QuicConn;
54 pub use request::{Body, PercentEncoder, Request, RequestBuilder};
55 pub use response::Response;
56 pub use uploader::{UploadOperator, Uploader, UploaderBuilder};
57 pub use ylong_http::body::{MultiPart, Part};
58 
59 // TODO: Remove these later.
60 /// Client Adapter.
61 pub type Client = client::Client<HttpConnector>;
62 
63 pub use dns::{Addrs, DefaultDnsResolver, Resolver, SocketFuture, StdError};
64