Skip to content

Commit

Permalink
docs: add cfg notes about http3 builder methods (#2070)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Dec 18, 2023
1 parent 6b901b1 commit c65dd7f
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/async_impl/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@ impl ClientBuilder {

/// Only use HTTP/3.
#[cfg(feature = "http3")]
#[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))]
pub fn http3_prior_knowledge(mut self) -> ClientBuilder {
self.config.http_version_pref = HttpVersionPref::Http3;
self
Expand Down Expand Up @@ -1512,6 +1513,14 @@ impl ClientBuilder {
self
}

/// Restrict the Client to be used with HTTPS only requests.
///
/// Defaults to false.
pub fn https_only(mut self, enabled: bool) -> ClientBuilder {
self.config.https_only = enabled;
self
}

/// Enables the [trust-dns](trust_dns_resolver) async resolver instead of a default threadpool using `getaddrinfo`.
///
/// If the `trust-dns` feature is turned on, the default option is enabled.
Expand Down Expand Up @@ -1543,14 +1552,6 @@ impl ClientBuilder {
}
}

/// Restrict the Client to be used with HTTPS only requests.
///
/// Defaults to false.
pub fn https_only(mut self, enabled: bool) -> ClientBuilder {
self.config.https_only = enabled;
self
}

/// Override DNS resolution for specific domains to a particular IP address.
///
/// Warning
Expand Down Expand Up @@ -1593,6 +1594,7 @@ impl ClientBuilder {
///
/// The default is false.
#[cfg(feature = "http3")]
#[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))]
pub fn set_tls_enable_early_data(mut self, enabled: bool) -> ClientBuilder {
self.config.tls_enable_early_data = enabled;
self
Expand All @@ -1604,6 +1606,7 @@ impl ClientBuilder {
///
/// [`TransportConfig`]: https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html
#[cfg(feature = "http3")]
#[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))]
pub fn set_quic_max_idle_timeout(mut self, value: Duration) -> ClientBuilder {
self.config.quic_max_idle_timeout = Some(value);
self
Expand All @@ -1616,6 +1619,7 @@ impl ClientBuilder {
///
/// [`TransportConfig`]: https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html
#[cfg(feature = "http3")]
#[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))]
pub fn set_quic_stream_receive_window(mut self, value: VarInt) -> ClientBuilder {
self.config.quic_stream_receive_window = Some(value);
self
Expand All @@ -1628,6 +1632,7 @@ impl ClientBuilder {
///
/// [`TransportConfig`]: https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html
#[cfg(feature = "http3")]
#[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))]
pub fn set_quic_receive_window(mut self, value: VarInt) -> ClientBuilder {
self.config.quic_receive_window = Some(value);
self
Expand All @@ -1639,6 +1644,7 @@ impl ClientBuilder {
///
/// [`TransportConfig`]: https://docs.rs/quinn/latest/quinn/struct.TransportConfig.html
#[cfg(feature = "http3")]
#[cfg_attr(docsrs, doc(cfg(all(reqwest_unstable, feature = "http3",))))]
pub fn set_quic_send_window(mut self, value: u64) -> ClientBuilder {
self.config.quic_send_window = Some(value);
self
Expand Down

0 comments on commit c65dd7f

Please sign in to comment.