diff --git a/src/client/conn/http2.rs b/src/client/conn/http2.rs index 9f3c5925bd..5b9e05470c 100644 --- a/src/client/conn/http2.rs +++ b/src/client/conn/http2.rs @@ -278,7 +278,7 @@ impl Builder { /// If not set, hyper will use a default. /// /// [spec]: https://http2.github.io/http2-spec/#SETTINGS_INITIAL_WINDOW_SIZE - pub fn http2_initial_stream_window_size(&mut self, sz: impl Into>) -> &mut Self { + pub fn initial_stream_window_size(&mut self, sz: impl Into>) -> &mut Self { if let Some(sz) = sz.into() { self.h2_builder.adaptive_window = false; self.h2_builder.initial_stream_window_size = sz; @@ -291,7 +291,7 @@ impl Builder { /// Passing `None` will do nothing. /// /// If not set, hyper will use a default. - pub fn http2_initial_connection_window_size( + pub fn initial_connection_window_size( &mut self, sz: impl Into>, ) -> &mut Self { @@ -305,9 +305,9 @@ impl Builder { /// Sets whether to use an adaptive flow control. /// /// Enabling this will override the limits set in - /// `http2_initial_stream_window_size` and - /// `http2_initial_connection_window_size`. - pub fn http2_adaptive_window(&mut self, enabled: bool) -> &mut Self { + /// `initial_stream_window_size` and + /// `initial_connection_window_size`. + pub fn adaptive_window(&mut self, enabled: bool) -> &mut Self { use proto::h2::SPEC_WINDOW_SIZE; self.h2_builder.adaptive_window = enabled; @@ -323,7 +323,7 @@ impl Builder { /// Passing `None` will do nothing. /// /// If not set, hyper will use a default. - pub fn http2_max_frame_size(&mut self, sz: impl Into>) -> &mut Self { + pub fn max_frame_size(&mut self, sz: impl Into>) -> &mut Self { if let Some(sz) = sz.into() { self.h2_builder.max_frame_size = sz; } @@ -336,7 +336,7 @@ impl Builder { /// Pass `None` to disable HTTP2 keep-alive. /// /// Default is currently disabled. - pub fn http2_keep_alive_interval( + pub fn keep_alive_interval( &mut self, interval: impl Into>, ) -> &mut Self { @@ -347,10 +347,10 @@ impl Builder { /// Sets a timeout for receiving an acknowledgement of the keep-alive ping. /// /// If the ping is not acknowledged within the timeout, the connection will - /// be closed. Does nothing if `http2_keep_alive_interval` is disabled. + /// be closed. Does nothing if `keep_alive_interval` is disabled. /// /// Default is 20 seconds. - pub fn http2_keep_alive_timeout(&mut self, timeout: Duration) -> &mut Self { + pub fn keep_alive_timeout(&mut self, timeout: Duration) -> &mut Self { self.h2_builder.keep_alive_timeout = timeout; self } @@ -359,11 +359,11 @@ impl Builder { /// /// If disabled, keep-alive pings are only sent while there are open /// request/responses streams. If enabled, pings are also sent when no - /// streams are active. Does nothing if `http2_keep_alive_interval` is + /// streams are active. Does nothing if `keep_alive_interval` is /// disabled. /// /// Default is `false`. - pub fn http2_keep_alive_while_idle(&mut self, enabled: bool) -> &mut Self { + pub fn keep_alive_while_idle(&mut self, enabled: bool) -> &mut Self { self.h2_builder.keep_alive_while_idle = enabled; self } @@ -376,7 +376,7 @@ impl Builder { /// The default value is determined by the `h2` crate. /// /// [`h2::client::Builder::max_concurrent_reset_streams`]: https://docs.rs/h2/client/struct.Builder.html#method.max_concurrent_reset_streams - pub fn http2_max_concurrent_reset_streams(&mut self, max: usize) -> &mut Self { + pub fn max_concurrent_reset_streams(&mut self, max: usize) -> &mut Self { self.h2_builder.max_concurrent_reset_streams = Some(max); self } @@ -388,7 +388,7 @@ impl Builder { /// # Panics /// /// The value must be no larger than `u32::MAX`. - pub fn http2_max_send_buf_size(&mut self, max: usize) -> &mut Self { + pub fn max_send_buf_size(&mut self, max: usize) -> &mut Self { assert!(max <= std::u32::MAX as usize); self.h2_builder.max_send_buffer_size = max; self diff --git a/tests/client.rs b/tests/client.rs index e01d49fbe9..aa88917215 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -1982,10 +1982,10 @@ mod conn { let (_client, conn) = conn::http2::Builder::new() .executor(TokioExecutor) .timer(TokioTimer) - .http2_keep_alive_interval(Duration::from_secs(1)) - .http2_keep_alive_timeout(Duration::from_secs(1)) + .keep_alive_interval(Duration::from_secs(1)) + .keep_alive_timeout(Duration::from_secs(1)) // enable while idle since we aren't sending requests - .http2_keep_alive_while_idle(true) + .keep_alive_while_idle(true) .handshake::<_, hyper::body::Incoming>(io) .await .expect("http handshake"); @@ -2011,8 +2011,8 @@ mod conn { let (mut client, conn) = conn::http2::Builder::new() .executor(TokioExecutor) .timer(TokioTimer) - .http2_keep_alive_interval(Duration::from_secs(1)) - .http2_keep_alive_timeout(Duration::from_secs(1)) + .keep_alive_interval(Duration::from_secs(1)) + .keep_alive_timeout(Duration::from_secs(1)) .handshake::<_, hyper::body::Incoming>(io) .await .expect("http handshake"); @@ -2043,8 +2043,8 @@ mod conn { let (mut client, conn) = conn::http2::Builder::new() .executor(TokioExecutor) .timer(TokioTimer) - .http2_keep_alive_interval(Duration::from_secs(1)) - .http2_keep_alive_timeout(Duration::from_secs(1)) + .keep_alive_interval(Duration::from_secs(1)) + .keep_alive_timeout(Duration::from_secs(1)) .handshake(io) .await .expect("http handshake"); @@ -2103,8 +2103,8 @@ mod conn { let (mut client, conn) = conn::http2::Builder::new() .executor(TokioExecutor) .timer(TokioTimer) - .http2_keep_alive_interval(Duration::from_secs(1)) - .http2_keep_alive_timeout(Duration::from_secs(1)) + .keep_alive_interval(Duration::from_secs(1)) + .keep_alive_timeout(Duration::from_secs(1)) .handshake(io) .await .expect("http handshake");