docs(client): touch ups for Client, Builder, and connect types

This commit is contained in:
Sean McArthur
2019-01-10 12:18:16 -08:00
parent 607c4da0b9
commit 8842da9184
3 changed files with 84 additions and 13 deletions

View File

@@ -41,13 +41,14 @@ pub struct HttpConnector<R = GaiResolver> {
///
/// # Example
///
/// ```rust
/// ```
/// use hyper::Uri;
/// use hyper::client::{Client, connect::HttpInfo};
/// use hyper::rt::Future;
///
/// let client = Client::new();
///
/// let fut = client.get("http://example.local".parse().unwrap())
/// let fut = client.get(Uri::from_static("http://example.local"))
/// .inspect(|resp| {
/// resp
/// .extensions()

View File

@@ -34,6 +34,8 @@ pub trait Connect: Send + Sync {
}
/// A set of properties to describe where and how to try to connect.
///
/// This type is passed an argument for the [`Connect`](Connect) trait.
#[derive(Clone, Debug)]
pub struct Destination {
pub(super) uri: Uri,
@@ -254,8 +256,19 @@ impl Connected {
/// Set whether the connected transport is to an HTTP proxy.
///
/// This setting will affect if HTTP/1 requests written on the transport
/// will have the request-target in absolute-form or origin-form (such as
/// `GET http://hyper.rs/guide HTTP/1.1` or `GET /guide HTTP/1.1`).
/// will have the request-target in absolute-form or origin-form:
///
/// - When `proxy(false)`:
///
/// ```http
/// GET /guide HTTP/1.1
/// ```
///
/// - When `proxy(true)`:
///
/// ```http
/// GET http://hyper.rs/guide HTTP/1.1
/// ```
///
/// Default is `false`.
pub fn proxy(mut self, is_proxied: bool) -> Connected {