• 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 conn;
28 mod connector;
29 mod downloader;
30 mod http_body;
31 mod pool;
32 mod timeout;
33 mod uploader;
34 
35 pub use client::ClientBuilder;
36 pub(crate) use conn::StreamData;
37 pub use connector::Connector;
38 pub(crate) use connector::HttpConnector;
39 pub use downloader::{DownloadOperator, Downloader, DownloaderBuilder};
40 pub use http_body::HttpBody;
41 pub(crate) use pool::ConnPool;
42 pub use uploader::{UploadOperator, Uploader, UploaderBuilder};
43 pub use ylong_http::body::async_impl::Body;
44 pub use ylong_http::body::{MultiPart, Part};
45 
46 #[cfg(feature = "__tls")]
47 mod ssl_stream;
48 
49 // TODO: Remove these later.
50 /// Client Adapter.
51 pub type Client = client::Client<HttpConnector>;
52 
53 // TODO: Remove these later.
54 mod adapter;
55 pub use adapter::{RequestBuilder, Response};
56