Struct Builder
pub struct Builder { /* private fields */ }http and http-full only.Expand description
A configuration builder for HTTP/2 server connections.
Note: The default values of options are not considered stable. They are subject to change at any time.
Implementations§
§impl Builder
impl Builder
pub fn maybe_with_max_pending_accept_reset_streams(
self,
max: Option<usize>,
) -> Builder
pub fn maybe_with_max_pending_accept_reset_streams( self, max: Option<usize>, ) -> Builder
Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
This will default to the default value set by the h2 crate.
As of v0.4.0, it is 20.
See https://github.com/hyperium/hyper/issues/2877 for more information.
pub fn maybe_set_max_pending_accept_reset_streams(
&mut self,
max: Option<usize>,
) -> &mut Builder
pub fn maybe_set_max_pending_accept_reset_streams( &mut self, max: Option<usize>, ) -> &mut Builder
Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
This will default to the default value set by the h2 crate.
As of v0.4.0, it is 20.
See https://github.com/hyperium/hyper/issues/2877 for more information.
pub fn with_max_pending_accept_reset_streams(self, max: usize) -> Builder
pub fn with_max_pending_accept_reset_streams(self, max: usize) -> Builder
Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
This will default to the default value set by the h2 crate.
As of v0.4.0, it is 20.
See https://github.com/hyperium/hyper/issues/2877 for more information.
pub fn set_max_pending_accept_reset_streams(
&mut self,
max: usize,
) -> &mut Builder
pub fn set_max_pending_accept_reset_streams( &mut self, max: usize, ) -> &mut Builder
Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
This will default to the default value set by the h2 crate.
As of v0.4.0, it is 20.
See https://github.com/hyperium/hyper/issues/2877 for more information.
pub fn without_max_pending_accept_reset_streams(self) -> Builder
pub fn without_max_pending_accept_reset_streams(self) -> Builder
Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
This will default to the default value set by the h2 crate.
As of v0.4.0, it is 20.
See https://github.com/hyperium/hyper/issues/2877 for more information.
pub fn unset_max_pending_accept_reset_streams(&mut self) -> &mut Builder
pub fn unset_max_pending_accept_reset_streams(&mut self) -> &mut Builder
Configures the maximum number of pending reset streams allowed before a GOAWAY will be sent.
This will default to the default value set by the h2 crate.
As of v0.4.0, it is 20.
See https://github.com/hyperium/hyper/issues/2877 for more information.
pub fn maybe_with_max_local_error_reset_streams(
self,
max: Option<usize>,
) -> Builder
pub fn maybe_with_max_local_error_reset_streams( self, max: Option<usize>, ) -> Builder
Configures the maximum number of local reset streams allowed before a GOAWAY will be sent.
If not set, rama_http_core will use a default, currently of 1024.
If None is supplied, rama_http_core will not apply any limit.
This is not advised, as it can potentially expose servers to DOS vulnerabilities.
See https://rustsec.org/advisories/RUSTSEC-2024-0003.html for more information.
pub fn maybe_set_max_local_error_reset_streams(
&mut self,
max: Option<usize>,
) -> &mut Builder
pub fn maybe_set_max_local_error_reset_streams( &mut self, max: Option<usize>, ) -> &mut Builder
Configures the maximum number of local reset streams allowed before a GOAWAY will be sent.
If not set, rama_http_core will use a default, currently of 1024.
If None is supplied, rama_http_core will not apply any limit.
This is not advised, as it can potentially expose servers to DOS vulnerabilities.
See https://rustsec.org/advisories/RUSTSEC-2024-0003.html for more information.
pub fn with_max_local_error_reset_streams(self, max: usize) -> Builder
pub fn with_max_local_error_reset_streams(self, max: usize) -> Builder
Configures the maximum number of local reset streams allowed before a GOAWAY will be sent.
If not set, rama_http_core will use a default, currently of 1024.
If None is supplied, rama_http_core will not apply any limit.
This is not advised, as it can potentially expose servers to DOS vulnerabilities.
See https://rustsec.org/advisories/RUSTSEC-2024-0003.html for more information.
pub fn set_max_local_error_reset_streams(&mut self, max: usize) -> &mut Builder
pub fn set_max_local_error_reset_streams(&mut self, max: usize) -> &mut Builder
Configures the maximum number of local reset streams allowed before a GOAWAY will be sent.
If not set, rama_http_core will use a default, currently of 1024.
If None is supplied, rama_http_core will not apply any limit.
This is not advised, as it can potentially expose servers to DOS vulnerabilities.
See https://rustsec.org/advisories/RUSTSEC-2024-0003.html for more information.
pub fn without_max_local_error_reset_streams(self) -> Builder
pub fn without_max_local_error_reset_streams(self) -> Builder
Configures the maximum number of local reset streams allowed before a GOAWAY will be sent.
If not set, rama_http_core will use a default, currently of 1024.
If None is supplied, rama_http_core will not apply any limit.
This is not advised, as it can potentially expose servers to DOS vulnerabilities.
See https://rustsec.org/advisories/RUSTSEC-2024-0003.html for more information.
pub fn unset_max_local_error_reset_streams(&mut self) -> &mut Builder
pub fn unset_max_local_error_reset_streams(&mut self) -> &mut Builder
Configures the maximum number of local reset streams allowed before a GOAWAY will be sent.
If not set, rama_http_core will use a default, currently of 1024.
If None is supplied, rama_http_core will not apply any limit.
This is not advised, as it can potentially expose servers to DOS vulnerabilities.
See https://rustsec.org/advisories/RUSTSEC-2024-0003.html for more information.
pub fn with_initial_stream_window_size(self, sz: u32) -> Builder
pub fn with_initial_stream_window_size(self, sz: u32) -> Builder
Sets the SETTINGS_INITIAL_WINDOW_SIZE option for HTTP2
stream-level flow control.
If not set, rama_http_core will use a default.
pub fn set_initial_stream_window_size(&mut self, sz: u32) -> &mut Builder
pub fn set_initial_stream_window_size(&mut self, sz: u32) -> &mut Builder
Sets the SETTINGS_INITIAL_WINDOW_SIZE option for HTTP2
stream-level flow control.
If not set, rama_http_core will use a default.
pub fn with_initial_connection_window_size(self, sz: u32) -> Builder
pub fn with_initial_connection_window_size(self, sz: u32) -> Builder
Sets the max connection-level flow control for HTTP2.
If not set, rama_http_core will use a default.
pub fn set_initial_connection_window_size(&mut self, sz: u32) -> &mut Builder
pub fn set_initial_connection_window_size(&mut self, sz: u32) -> &mut Builder
Sets the max connection-level flow control for HTTP2.
If not set, rama_http_core will use a default.
pub fn with_adaptive_window(self, enabled: bool) -> Builder
pub fn with_adaptive_window(self, enabled: bool) -> Builder
Sets whether to use an adaptive flow control.
Enabling this will override the limits set in
initial_stream_window_size and
initial_connection_window_size.
pub fn set_adaptive_window(&mut self, enabled: bool) -> &mut Builder
pub fn set_adaptive_window(&mut self, enabled: bool) -> &mut Builder
Sets whether to use an adaptive flow control.
Enabling this will override the limits set in
initial_stream_window_size and
initial_connection_window_size.
pub fn with_max_frame_size(self, sz: u32) -> Builder
pub fn with_max_frame_size(self, sz: u32) -> Builder
Sets the maximum frame size to use for HTTP2.
If not set, rama_http_core will use a default.
pub fn set_max_frame_size(&mut self, sz: u32) -> &mut Builder
pub fn set_max_frame_size(&mut self, sz: u32) -> &mut Builder
Sets the maximum frame size to use for HTTP2.
If not set, rama_http_core will use a default.
pub fn maybe_with_max_concurrent_streams(self, max: Option<u32>) -> Builder
pub fn maybe_with_max_concurrent_streams(self, max: Option<u32>) -> Builder
Sets the SETTINGS_MAX_CONCURRENT_STREAMS option for HTTP2
connections.
Default is 200, but not part of the stability of rama_http_core. It could change in a future release. You are encouraged to set your own limit.
Passing None will remove any limit.
pub fn maybe_set_max_concurrent_streams(
&mut self,
max: Option<u32>,
) -> &mut Builder
pub fn maybe_set_max_concurrent_streams( &mut self, max: Option<u32>, ) -> &mut Builder
Sets the SETTINGS_MAX_CONCURRENT_STREAMS option for HTTP2
connections.
Default is 200, but not part of the stability of rama_http_core. It could change in a future release. You are encouraged to set your own limit.
Passing None will remove any limit.
pub fn with_max_concurrent_streams(self, max: u32) -> Builder
pub fn with_max_concurrent_streams(self, max: u32) -> Builder
Sets the SETTINGS_MAX_CONCURRENT_STREAMS option for HTTP2
connections.
Default is 200, but not part of the stability of rama_http_core. It could change in a future release. You are encouraged to set your own limit.
Passing None will remove any limit.
pub fn set_max_concurrent_streams(&mut self, max: u32) -> &mut Builder
pub fn set_max_concurrent_streams(&mut self, max: u32) -> &mut Builder
Sets the SETTINGS_MAX_CONCURRENT_STREAMS option for HTTP2
connections.
Default is 200, but not part of the stability of rama_http_core. It could change in a future release. You are encouraged to set your own limit.
Passing None will remove any limit.
pub fn without_max_concurrent_streams(self) -> Builder
pub fn without_max_concurrent_streams(self) -> Builder
Sets the SETTINGS_MAX_CONCURRENT_STREAMS option for HTTP2
connections.
Default is 200, but not part of the stability of rama_http_core. It could change in a future release. You are encouraged to set your own limit.
Passing None will remove any limit.
pub fn unset_max_concurrent_streams(&mut self) -> &mut Builder
pub fn unset_max_concurrent_streams(&mut self) -> &mut Builder
Sets the SETTINGS_MAX_CONCURRENT_STREAMS option for HTTP2
connections.
Default is 200, but not part of the stability of rama_http_core. It could change in a future release. You are encouraged to set your own limit.
Passing None will remove any limit.
pub fn maybe_with_keep_alive_interval(
self,
interval: Option<Duration>,
) -> Builder
pub fn maybe_with_keep_alive_interval( self, interval: Option<Duration>, ) -> Builder
Sets an interval for HTTP2 Ping frames should be sent to keep a connection alive.
Pass None to disable HTTP2 keep-alive.
Default is currently disabled.
pub fn maybe_set_keep_alive_interval(
&mut self,
interval: Option<Duration>,
) -> &mut Builder
pub fn maybe_set_keep_alive_interval( &mut self, interval: Option<Duration>, ) -> &mut Builder
Sets an interval for HTTP2 Ping frames should be sent to keep a connection alive.
Pass None to disable HTTP2 keep-alive.
Default is currently disabled.
pub fn with_keep_alive_interval(self, interval: Duration) -> Builder
pub fn with_keep_alive_interval(self, interval: Duration) -> Builder
Sets an interval for HTTP2 Ping frames should be sent to keep a connection alive.
Pass None to disable HTTP2 keep-alive.
Default is currently disabled.
pub fn set_keep_alive_interval(&mut self, interval: Duration) -> &mut Builder
pub fn set_keep_alive_interval(&mut self, interval: Duration) -> &mut Builder
Sets an interval for HTTP2 Ping frames should be sent to keep a connection alive.
Pass None to disable HTTP2 keep-alive.
Default is currently disabled.
pub fn without_keep_alive_interval(self) -> Builder
pub fn without_keep_alive_interval(self) -> Builder
Sets an interval for HTTP2 Ping frames should be sent to keep a connection alive.
Pass None to disable HTTP2 keep-alive.
Default is currently disabled.
pub fn unset_keep_alive_interval(&mut self) -> &mut Builder
pub fn unset_keep_alive_interval(&mut self) -> &mut Builder
Sets an interval for HTTP2 Ping frames should be sent to keep a connection alive.
Pass None to disable HTTP2 keep-alive.
Default is currently disabled.
pub fn with_keep_alive_timeout(self, timeout: Duration) -> Builder
pub fn with_keep_alive_timeout(self, timeout: Duration) -> 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 keep_alive_interval is disabled.
Default is 20 seconds.
pub fn set_keep_alive_timeout(&mut self, timeout: Duration) -> &mut Builder
pub fn set_keep_alive_timeout(&mut self, timeout: Duration) -> &mut 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 keep_alive_interval is disabled.
Default is 20 seconds.
pub fn with_max_send_buf_size(self, max: u32) -> Builder
pub fn with_max_send_buf_size(self, max: u32) -> Builder
Set the maximum write buffer size for each HTTP/2 stream.
Default is currently ~400KB, but may change.
pub fn set_max_send_buf_size(&mut self, max: u32) -> &mut Builder
pub fn set_max_send_buf_size(&mut self, max: u32) -> &mut Builder
Set the maximum write buffer size for each HTTP/2 stream.
Default is currently ~400KB, but may change.
pub fn with_enable_connect_protocol(self) -> Builder
pub fn with_enable_connect_protocol(self) -> Builder
Enables the extended CONNECT protocol.
pub fn set_enable_connect_protocol(&mut self) -> &mut Builder
pub fn set_enable_connect_protocol(&mut self) -> &mut Builder
Enables the extended CONNECT protocol.
pub fn with_max_header_list_size(self, max: u32) -> Builder
pub fn with_max_header_list_size(self, max: u32) -> Builder
Sets the max size of received header frames.
Default is currently 16KB, but can change.
pub fn set_max_header_list_size(&mut self, max: u32) -> &mut Builder
pub fn set_max_header_list_size(&mut self, max: u32) -> &mut Builder
Sets the max size of received header frames.
Default is currently 16KB, but can change.
pub fn with_auto_date_header(self, enabled: bool) -> Builder
pub fn with_auto_date_header(self, enabled: bool) -> Builder
Set whether the date header should be included in HTTP responses.
Note that including the date header is recommended by RFC 7231.
Default is true.
pub fn set_auto_date_header(&mut self, enabled: bool) -> &mut Builder
pub fn set_auto_date_header(&mut self, enabled: bool) -> &mut Builder
Set whether the date header should be included in HTTP responses.
Note that including the date header is recommended by RFC 7231.
Default is true.
pub fn serve_connection<S, I>(&self, io: I, service: S) -> Connection<I, S> ⓘ
pub fn serve_connection<S, I>(&self, io: I, service: S) -> Connection<I, S> ⓘ
Bind a connection together with a Service.
This returns a Future that must be polled in order for HTTP to be driven on the connection.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more