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 interceptor;
33 mod request;
34 mod response;
35 mod timeout;
36 mod uploader;
37 
38 #[cfg(feature = "__tls")]
39 mod ssl_stream;
40 
41 pub(crate) mod conn;
42 pub(crate) mod pool;
43 
44 pub use client::ClientBuilder;
45 pub use connector::{Connector, HttpConnector};
46 pub use downloader::{DownloadOperator, Downloader, DownloaderBuilder};
47 pub use http_body::HttpBody;
48 pub use interceptor::{ConnDetail, ConnProtocol, Interceptor};
49 pub use request::{Body, PercentEncoder, Request, RequestBuilder};
50 pub use response::Response;
51 pub use uploader::{UploadOperator, Uploader, UploaderBuilder};
52 pub use ylong_http::body::{MultiPart, Part};
53 
54 // TODO: Remove these later.
55 /// Client Adapter.
56 pub type Client = client::Client<HttpConnector>;
57 
58 pub use dns::{Addrs, DefaultDnsResolver, Resolver, SocketFuture, StdError};
59