Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add cfg notes about http3 builder methods #2070

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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